use of org.eclipse.wst.server.core.internal.IInstallableRuntime in project webtools.servertools by eclipse.
the class InstallableRuntimeDecorator method decorate.
public void decorate(final GenericServerComposite composite) {
final IInstallableRuntime ir = ServerPlugin.findInstallableRuntime(fRuntime.getRuntime().getRuntimeType().getId());
Button install = SWTUtil.createButton(composite, GenericServerUIMessages.installServerButton);
install.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent se) {
DirectoryDialog dialog = new DirectoryDialog(composite.getShell());
dialog.setMessage(GenericServerUIMessages.installationDirectory);
final String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
ir.install(new Path(selectedDirectory), new NullProgressMonitor());
} catch (CoreException e) {
Trace.trace(Trace.SEVERE, "Error installing runtime", // $NON-NLS-1$
e);
}
}
};
try {
fWizard.run(true, false, runnable);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error installing runtime", // $NON-NLS-1$
e);
}
}
}
});
}
use of org.eclipse.wst.server.core.internal.IInstallableRuntime in project webtools.servertools by eclipse.
the class GenericServerRuntimeWizardFragment method createContent.
public void createContent(Composite parent, IWizardHandle handle) {
Map properties = null;
ServerRuntime definition = null;
if (getRuntimeDelegate() != null) {
properties = getRuntimeDelegate().getServerInstanceProperties();
definition = getServerTypeDefinition(getServerDefinitionId(), properties);
}
IInstallableRuntime ir = ServerPlugin.findInstallableRuntime(getRuntimeDelegate().getRuntime().getRuntimeType().getId());
if (ir != null) {
fDecorators = new GenericServerCompositeDecorator[3];
fDecorators[0] = new JRESelectDecorator(getRuntimeDelegate(), getWizard());
fDecorators[1] = new ServerTypeDefinitionRuntimeDecorator(definition, properties, getWizard(), getRuntimeDelegate());
fDecorators[2] = new InstallableRuntimeDecorator(getWizard(), getRuntimeDelegate());
} else {
fDecorators = new GenericServerCompositeDecorator[2];
fDecorators[0] = new JRESelectDecorator(getRuntimeDelegate(), getWizard());
fDecorators[1] = new ServerTypeDefinitionRuntimeDecorator(definition, properties, getWizard(), getRuntimeDelegate());
}
new GenericServerComposite(parent, fDecorators);
}
Aggregations