[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] to display second page
|
- From: lowleong27@xxxxxxxxx (damon leong)
- Date: Wed, 11 Oct 2006 09:28:40 +0000 (UTC)
- Newsgroups: eclipse.platform.swt
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
hi all,
i am try click on button on the first page
and after i click on it the workbench should display second page
but i cannot get it work ...
and if try to do it like pop up window is fine...
and i don't want to use the menu bar to trigger it...
this is not problem i use the menu bar to trigger it to display second page
any one have a idea ? please help...
below is my part of source:
i use the signinBtn to trigger it out ...
the subscriptionAction.run(); the run() method to display the page...
public void createPartControl(final Composite parent) {
Composite compositeLogin = new Composite(parent, SWT.CENTER);
GridLayout layout = new GridLayout();
layout.marginHeight = 25;
layout.marginWidth = 50;
layout.verticalSpacing = 15;
layout.numColumns = 2;
compositeLogin.setLayout(layout);
final Label emailLbl = new Label(compositeLogin, SWT.LEFT);
emailLbl.setText(" Email:");
final Text emailTxt = new Text(compositeLogin, SWT.BORDER
| SWT.SINGLE);
emailTxt.setLayoutData(new GridData(100, 15));
emailTxt.setTextLimit(20);
emailTxt.setFocus();
Label passwordLbl = new Label(compositeLogin, SWT.LEFT);
passwordLbl.setText(" Password:");
final Text passwordTxt = new Text(compositeLogin, SWT.BORDER
| SWT.SINGLE);
passwordTxt.setLayoutData(new GridData(100, 15));
passwordTxt.setEchoChar('*');
passwordTxt.setTextLimit(12);
final Button signinBtn = new Button(compositeLogin, SWT.PUSH);
signinBtn.setText(" Login ");
signinBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
SubscriptionAction subscriptionAction = new
SubscriptionAction(window, "",SubscriptionView.ID);
subscriptionAction.run();
}
});
}
public void setFocus() {
}
}
this is my run method ...
public void run() {
if (window != null) {
try {
IViewReference viewRefs[] = window.getActivePage()
.getViewReferences();
for (int i = 0; i < viewRefs.length; i++) {
window.getActivePage().hideView(viewRefs[i]);
}
window.getActivePage().showView(viewId);
} catch (PartInitException e) {
MessageDialog.openError(window.getShell(), "Error",
"Error opening view:" + e.getMessage());
}
}
}