Search in sources :

Example 6 with IModuleType

use of org.eclipse.wst.server.core.IModuleType in project webtools.servertools by eclipse.

the class NewServerComposite method createManualComposite.

protected void createManualComposite(Composite comp) {
    manualComp2 = new Composite(comp, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
    layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.numColumns = 1;
    manualComp2.setLayout(layout);
    manualComp2.setLayoutData(new GridData(GridData.FILL_BOTH));
    IModuleType mt = moduleType;
    boolean includeIncompatible = true;
    if (moduleType != null)
        includeIncompatible = false;
    if (module != null)
        mt = module.getModuleType();
    manualComp = new NewManualServerComposite(manualComp2, new NewManualServerComposite.IWizardHandle2() {

        public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InterruptedException, InvocationTargetException {
            wizard.run(fork, cancelable, runnable);
        }

        public void update() {
            wizard.update();
        }

        public void setMessage(String newMessage, int newType) {
            wizard.setMessage(newMessage, newType);
        }
    }, mt, module, serverTypeId, includeIncompatible, new NewManualServerComposite.ServerSelectionListener() {

        public void serverSelected(IServerAttributes server) {
            updateTaskModel();
        }

        public void runtimeSelected(IRuntime runtime) {
            updateTaskModel();
        }
    });
    if (lastHostname != null)
        manualComp.setHost(lastHostname);
    else
        manualComp.setHost("localhost");
    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    data.heightHint = 360;
    manualComp.setLayoutData(data);
}
Also used : IServerAttributes(org.eclipse.wst.server.core.IServerAttributes) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ServerComposite(org.eclipse.wst.server.ui.internal.viewers.ServerComposite) IModuleType(org.eclipse.wst.server.core.IModuleType) GridData(org.eclipse.swt.layout.GridData) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) IRuntime(org.eclipse.wst.server.core.IRuntime)

Aggregations

IModuleType (org.eclipse.wst.server.core.IModuleType)6 CoreException (org.eclipse.core.runtime.CoreException)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 IModule (org.eclipse.wst.server.core.IModule)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IProject (org.eclipse.core.resources.IProject)1 IAdaptable (org.eclipse.core.runtime.IAdaptable)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Label (org.eclipse.swt.widgets.Label)1 Table (org.eclipse.swt.widgets.Table)1 TableItem (org.eclipse.swt.widgets.TableItem)1 IRuntime (org.eclipse.wst.server.core.IRuntime)1