Search in sources :

Example 6 with ServerWorkingCopy

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

the class NewServerWizardFragment method createChildFragments.

protected void createChildFragments(List<WizardFragment> list) {
    if (getTaskModel() == null)
        return;
    Byte b = getMode();
    if (b != null && b.byteValue() == MODE_MANUAL) {
        IServerAttributes server = (IServerAttributes) getTaskModel().getObject(TaskModel.TASK_SERVER);
        Object runtime = getTaskModel().getObject(TaskModel.TASK_RUNTIME);
        if (runtime != null && runtime instanceof IRuntimeWorkingCopy) {
            IServerType st = server == null ? null : server.getServerType();
            // It should be assumed that the optional runtime fragment is added by the adopter later
            if (st != null && st.requiresRuntime()) {
                WizardFragment sub = getWizardFragment(((IRuntime) runtime).getRuntimeType().getId());
                if (sub != null)
                    list.add(sub);
            }
        }
        if (server != null) {
            if (server.getServerType().hasServerConfiguration() && server instanceof ServerWorkingCopy && runtime instanceof IRuntime) {
                ServerWorkingCopy swc = (ServerWorkingCopy) server;
                IRuntime runtime1 = (IRuntime) runtime;
                if (runtime != null && runtime1.getLocation() != null && !runtime1.getLocation().isEmpty()) {
                    if (runtimeLocation == null || !runtimeLocation.equals(runtime1.getLocation()))
                        try {
                            swc.importRuntimeConfiguration(runtime1, null);
                        } catch (CoreException ce) {
                        // ignore
                        }
                    runtimeLocation = runtime1.getLocation();
                } else
                    runtimeLocation = null;
            }
            WizardFragment sub = getWizardFragment(server.getServerType().getId());
            if (sub != null) {
                list.add(sub);
            }
        }
    } else if (b != null && b.byteValue() == MODE_EXISTING) {
    /*if (comp != null) {
				IServer server = comp.getServer();
				if (server != null)
					list.add(new TasksWizardFragment());
			}*/
    }
}
Also used : ServerWorkingCopy(org.eclipse.wst.server.core.internal.ServerWorkingCopy) WizardFragment(org.eclipse.wst.server.ui.wizard.WizardFragment) CoreException(org.eclipse.core.runtime.CoreException)

Example 7 with ServerWorkingCopy

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

the class SetServerStartTimeoutCommand method execute.

/**
 * Execute the command.
 */
public void execute() {
    ServerWorkingCopy swc = (ServerWorkingCopy) server;
    oldTime = swc.getStartTimeout();
    swc.setStartTimeout(time);
}
Also used : ServerWorkingCopy(org.eclipse.wst.server.core.internal.ServerWorkingCopy) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy)

Example 8 with ServerWorkingCopy

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

the class SetServerStartTimeoutCommand method undo.

/**
 * Undo the command.
 */
public void undo() {
    ServerWorkingCopy swc = (ServerWorkingCopy) server;
    swc.setStartTimeout(oldTime);
}
Also used : ServerWorkingCopy(org.eclipse.wst.server.core.internal.ServerWorkingCopy) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy)

Example 9 with ServerWorkingCopy

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

the class SetServerAutoPublishTimeCommand method undo.

/**
 * Undo the command.
 */
public void undo() {
    ServerWorkingCopy swc = (ServerWorkingCopy) server;
    swc.setAutoPublishTime(oldTime);
}
Also used : ServerWorkingCopy(org.eclipse.wst.server.core.internal.ServerWorkingCopy) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy)

Example 10 with ServerWorkingCopy

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

the class SetServerAutoPublishTimeCommand method execute.

/**
 * Execute the command.
 */
public void execute() {
    ServerWorkingCopy swc = (ServerWorkingCopy) server;
    oldTime = swc.getAutoPublishTime();
    swc.setAutoPublishTime(time);
}
Also used : ServerWorkingCopy(org.eclipse.wst.server.core.internal.ServerWorkingCopy) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy)

Aggregations

ServerWorkingCopy (org.eclipse.wst.server.core.internal.ServerWorkingCopy)15 IServerWorkingCopy (org.eclipse.wst.server.core.IServerWorkingCopy)14 CoreException (org.eclipse.core.runtime.CoreException)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 IServerType (org.eclipse.wst.server.core.IServerType)2 WizardFragment (org.eclipse.wst.server.ui.wizard.WizardFragment)2 Test (org.junit.Test)2 IRuntimeWorkingCopy (org.eclipse.wst.server.core.IRuntimeWorkingCopy)1 IServer (org.eclipse.wst.server.core.IServer)1 RuntimeTypeWithServerProxy (org.eclipse.wst.server.core.internal.RuntimeTypeWithServerProxy)1 RuntimeWorkingCopy (org.eclipse.wst.server.core.internal.RuntimeWorkingCopy)1