use of org.eclipse.wst.server.http.core.internal.command.ModifyURLPrefixCommand in project webtools.servertools by eclipse.
the class HttpSection method createSection.
public void createSection(Composite parent) {
super.createSection(parent);
FormToolkit toolkit = getFormToolkit(parent.getDisplay());
Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
section.setText(Messages.editorSectionTitle);
section.setDescription(Messages.editorSectionDescription);
section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
Composite composite = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.marginHeight = 8;
layout.marginWidth = 8;
layout.numColumns = 2;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL));
toolkit.paintBordersFor(composite);
section.setClient(composite);
// URL prefix
Label label = createLabel(toolkit, composite, Messages.editorURLPrefix);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
// data.horizontalSpan = 2;
label.setLayoutData(data);
urlPrefixText = toolkit.createText(composite, "");
data = new GridData(GridData.FILL_HORIZONTAL);
// data.horizontalSpan = 2;
urlPrefixText.setLayoutData(data);
urlPrefixText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (updating)
return;
updating = true;
execute(new ModifyURLPrefixCommand(httpServer, urlPrefixText.getText()));
updating = false;
}
});
// port
createLabel(toolkit, composite, Messages.editorPort);
portSpinner = new Spinner(composite, SWT.BORDER);
portSpinner.setMinimum(0);
portSpinner.setMaximum(MAXIMUM_PORT);
portSpinner.setTextLimit((Integer.toString(MAXIMUM_PORT)).length());
data = new GridData(GridData.FILL_HORIZONTAL);
portSpinner.setLayoutData(data);
portSpinner.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (updating)
return;
updating = true;
execute(new ModifyPortCommand(httpServer, portSpinner.getSelection()));
updating = false;
}
});
// is publishing
publishCheckBox = new Button(composite, SWT.CHECK);
publishCheckBox.setText(Messages.editorShouldPublish);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
publishCheckBox.setLayoutData(data);
publishCheckBox.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent se) {
Button b = (Button) se.getSource();
if (updating)
return;
updating = true;
execute(new ModifyPublishingCommand(httpServer, b.getSelection()));
updating = false;
}
});
initialize();
}
Aggregations