use of org.eclipse.wst.server.ui.internal.wizard.NewServerWizard in project webtools.servertools by eclipse.
the class WizardTestCase method testNewServerWizard.
public void testNewServerWizard() throws Exception {
Shell shell = UITestHelper.getShell();
NewServerWizard wiz = new NewServerWizard();
WizardDialog dialog = new WizardDialog(shell, wiz);
UITestHelper.assertDialog(dialog);
}
use of org.eclipse.wst.server.ui.internal.wizard.NewServerWizard in project webtools.servertools by eclipse.
the class ServersView2 method createDefaultPage.
/**
* Creates a page displayed when there are no servers defined.
*
* @param kit
* @return Control
*/
private Control createDefaultPage(FormToolkit kit) {
Form form = kit.createForm(book);
Composite body = form.getBody();
GridLayout layout = new GridLayout(2, false);
body.setLayout(layout);
Link hlink = new Link(body, SWT.NONE);
hlink.setText(Messages.ServersView2_noServers);
hlink.setBackground(book.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
GridData gd = new GridData(SWT.LEFT, SWT.FILL, true, false);
hlink.setLayoutData(gd);
hlink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
NewServerWizard wizard = new NewServerWizard();
WizardDialog wd = new WizardDialog(book.getShell(), wizard);
if (wd.open() == Window.OK) {
toggleDefultPage();
}
}
});
// Create the context menu for the default page
final CommonViewer commonViewer = this.getCommonViewer();
if (commonViewer != null) {
ICommonViewerSite commonViewerSite = CommonViewerSiteFactory.createCommonViewerSite(this.getViewSite());
if (commonViewerSite != null) {
// Note: actionService cannot be null
final NavigatorActionService actionService = new NavigatorActionService(commonViewerSite, commonViewer, commonViewer.getNavigatorContentService());
MenuManager menuManager = new MenuManager("#PopupMenu");
menuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
ISelection selection = commonViewer.getSelection();
actionService.setContext(new ActionContext(selection));
actionService.fillContextMenu(mgr);
}
});
Menu menu = menuManager.createContextMenu(body);
// It is necessary to set the menu in two places:
// 1. The white space in the server view
// 2. The text and link in the server view. If this menu is not set, if the
// user right clicks on the text or uses shortcut keys to open the context menu,
// the context menu will not come up
body.setMenu(menu);
hlink.setMenu(menu);
} else {
if (Trace.FINEST) {
Trace.trace(Trace.STRING_FINEST, "The commonViewerSite is null");
}
}
} else {
if (Trace.FINEST) {
Trace.trace(Trace.STRING_FINEST, "The commonViewer is null");
}
}
return form;
}
use of org.eclipse.wst.server.ui.internal.wizard.NewServerWizard in project webtools.servertools by eclipse.
the class NewServerAction method run.
/**
* Performs this action.
* <p>
* This method is called when the delegating action has been triggered.
* Implement this method to do the actual work.
* </p>
*
* @param action the action proxy that handles the presentation portion of the
* action
*/
public void run(IAction action) {
NewServerWizard wizard = null;
if (ids == null)
wizard = new NewServerWizard();
else
wizard = new NewServerWizard(ids, values);
wizard.init(workbench, selection);
WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
dialog.setMinimumPageSize(300, 480);
dialog.open();
}
Aggregations