Search in sources :

Example 1 with ServerComposite

use of org.eclipse.wst.server.ui.internal.viewers.ServerComposite in project webtools.servertools by eclipse.

the class NewServerComposite method createExistingComposite.

protected void createExistingComposite(Composite comp) {
    existingComp = new ServerComposite(comp, new ServerComposite.ServerSelectionListener() {

        public void serverSelected(IServer server) {
            wizard.setMessage(null, IMessageProvider.NONE);
            // check for compatibility
            if (server != null && module != null) {
                IStatus status = isSupportedModule(server, module);
                if (status != null) {
                    if (status.getSeverity() == IStatus.ERROR) {
                        wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
                        server = null;
                    } else if (status.getSeverity() == IStatus.WARNING)
                        wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
                    else if (status.getSeverity() == IStatus.INFO)
                        wizard.setMessage(status.getMessage(), IMessageProvider.INFORMATION);
                }
            }
            if (existingWC != null) {
                if (server != null && server.equals(existingWC.getOriginal()))
                    return;
                existingWC = null;
            }
            if (server != null)
                existingWC = server.createWorkingCopy();
            updateTaskModel();
        }
    }, module, launchMode);
    existingComp.setIncludeIncompatibleVersions(true);
    GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    data.horizontalSpan = 3;
    data.heightHint = 150;
    existingComp.setLayoutData(data);
}
Also used : IServer(org.eclipse.wst.server.core.IServer) IStatus(org.eclipse.core.runtime.IStatus) ServerComposite(org.eclipse.wst.server.ui.internal.viewers.ServerComposite) GridData(org.eclipse.swt.layout.GridData)

Aggregations

IStatus (org.eclipse.core.runtime.IStatus)1 GridData (org.eclipse.swt.layout.GridData)1 IServer (org.eclipse.wst.server.core.IServer)1 ServerComposite (org.eclipse.wst.server.ui.internal.viewers.ServerComposite)1