Search in sources :

Example 1 with RuntimeDelegate

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

the class GenericServerRuntimeWizardFragment method createName.

private String createName() {
    RuntimeDelegate dl = getRuntimeDelegate();
    IRuntimeType runtimeType = dl.getRuntime().getRuntimeType();
    String name = NLS.bind(GenericServerUIMessages.runtimeName, runtimeType.getName());
    IRuntime[] list = ServerCore.getRuntimes();
    int suffix = 1;
    String suffixName = name;
    for (int i = 0; i < list.length; i++) {
        if ((list[i].getName().equals(name) || list[i].getName().equals(suffixName)) && !list[i].equals(dl.getRuntime()))
            suffix++;
        suffixName = name + ' ' + suffix;
    }
    if (suffix > 1)
        return suffixName;
    return name;
}
Also used : IRuntimeType(org.eclipse.wst.server.core.IRuntimeType) RuntimeDelegate(org.eclipse.wst.server.core.model.RuntimeDelegate) IRuntime(org.eclipse.wst.server.core.IRuntime)

Example 2 with RuntimeDelegate

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

the class GenericServerRuntimeWizardFragment method isComplete.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.wst.server.ui.wizard.IWizardFragment#isComplete()
     */
public boolean isComplete() {
    RuntimeDelegate runtime = getRuntimeDelegate();
    if (runtime == null)
        return false;
    IStatus status = runtime.validate();
    return (status != null && status.isOK());
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) RuntimeDelegate(org.eclipse.wst.server.core.model.RuntimeDelegate)

Aggregations

RuntimeDelegate (org.eclipse.wst.server.core.model.RuntimeDelegate)2 IStatus (org.eclipse.core.runtime.IStatus)1 IRuntime (org.eclipse.wst.server.core.IRuntime)1 IRuntimeType (org.eclipse.wst.server.core.IRuntimeType)1