|
Lines 87-92
Link Here
|
| 87 |
protected Button autoPublishDisable; |
87 |
protected Button autoPublishDisable; |
| 88 |
protected Button autoPublishOverride; |
88 |
protected Button autoPublishOverride; |
| 89 |
protected Spinner autoPublishTime; |
89 |
protected Spinner autoPublishTime; |
|
|
90 |
protected Spinner startTimeoutSpinner; |
| 91 |
protected Spinner stopTimeoutSpinner; |
| 90 |
|
92 |
|
| 91 |
protected boolean updating; |
93 |
protected boolean updating; |
| 92 |
|
94 |
|
|
Lines 238-243
Link Here
|
| 238 |
rightColumnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); |
240 |
rightColumnComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); |
| 239 |
|
241 |
|
| 240 |
createAutoPublishSection(rightColumnComp, toolkit); |
242 |
createAutoPublishSection(rightColumnComp, toolkit); |
|
|
243 |
createTimeoutSection(rightColumnComp, toolkit); |
| 241 |
|
244 |
|
| 242 |
insertSections(rightColumnComp, "org.eclipse.wst.server.editor.overview.right"); |
245 |
insertSections(rightColumnComp, "org.eclipse.wst.server.editor.overview.right"); |
| 243 |
|
246 |
|
|
Lines 643-649
Link Here
|
| 643 |
}); |
646 |
}); |
| 644 |
} |
647 |
} |
| 645 |
} |
648 |
} |
|
|
649 |
|
| 650 |
protected void createTimeoutSection(Composite rightColumnComp, FormToolkit toolkit) { |
| 651 |
Section section = toolkit.createSection(rightColumnComp, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE); |
| 652 |
section.setText(Messages.serverEditorOverviewTimeoutSection); |
| 653 |
section.setDescription(Messages.serverEditorOverviewTimeoutDescription); |
| 654 |
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); |
| 655 |
|
| 656 |
Composite composite = toolkit.createComposite(section); |
| 657 |
GridLayout layout = new GridLayout(); |
| 658 |
layout.numColumns = 4; |
| 659 |
layout.marginHeight = 5; |
| 660 |
layout.marginWidth = 10; |
| 661 |
layout.verticalSpacing = 5; |
| 662 |
layout.horizontalSpacing = 15; |
| 663 |
composite.setLayout(layout); |
| 664 |
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); |
| 665 |
IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem(); |
| 666 |
whs.setHelp(composite, ContextIds.EDITOR_OVERVIEW_PAGE); |
| 667 |
toolkit.paintBordersFor(composite); |
| 668 |
section.setClient(composite); |
| 669 |
|
| 670 |
// Timeout |
| 671 |
if (server != null) { |
| 672 |
final Server svr = (Server) server; |
| 673 |
|
| 674 |
// StartTimeout Label |
| 675 |
final Label startTimeoutLabel = toolkit.createLabel(composite, Messages.serverEditorOverviewStartTimeout); |
| 676 |
GridData data = new GridData(); |
| 677 |
data.horizontalIndent = 20; |
| 678 |
startTimeoutLabel.setLayoutData(data); |
| 679 |
|
| 680 |
startTimeoutSpinner = new Spinner(composite, SWT.BORDER); |
| 681 |
startTimeoutSpinner.setEnabled(true); |
| 682 |
startTimeoutSpinner.setMinimum(0); |
| 683 |
startTimeoutSpinner.setMaximum(1000*60*30); // 30 minutes |
| 684 |
startTimeoutSpinner.setSelection(svr.getStartTimeoutSetting()); |
| 685 |
setSpinnerTooltip(startTimeoutSpinner); |
| 686 |
data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
| 687 |
data.widthHint = 60; |
| 688 |
startTimeoutSpinner.setLayoutData(data); |
| 689 |
|
| 690 |
// StopTimeout Label |
| 691 |
final Label stopTimeoutLabel = toolkit.createLabel(composite, Messages.serverEditorOverviewStopTimeout); |
| 692 |
data = new GridData(); |
| 693 |
data.horizontalIndent = 20; |
| 694 |
stopTimeoutLabel.setLayoutData(data); |
| 695 |
|
| 696 |
stopTimeoutSpinner = new Spinner(composite, SWT.BORDER); |
| 697 |
stopTimeoutSpinner.setEnabled(true); |
| 698 |
stopTimeoutSpinner.setMinimum(0); |
| 699 |
stopTimeoutSpinner.setMaximum(1000*60*30); // 30 minutes |
| 700 |
stopTimeoutSpinner.setSelection(svr.getStopTimoutSetting()); |
| 701 |
setSpinnerTooltip(stopTimeoutSpinner); |
| 702 |
data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
| 703 |
data.widthHint = 60; |
| 704 |
stopTimeoutSpinner.setLayoutData(data); |
| 705 |
|
| 706 |
startTimeoutSpinner.addModifyListener(new ModifyListener(){ |
| 646 |
|
707 |
|
|
|
708 |
public void modifyText(ModifyEvent e) { |
| 709 |
if (updating) |
| 710 |
return; |
| 711 |
updating = true; |
| 712 |
try { |
| 713 |
setSpinnerTooltip(startTimeoutSpinner); |
| 714 |
execute(new SetServerStartTimeoutCommand(getServer(), startTimeoutSpinner.getSelection())); |
| 715 |
} catch (Exception ex) { |
| 716 |
// ignore |
| 717 |
} |
| 718 |
updating = false; |
| 719 |
validate(); |
| 720 |
|
| 721 |
} |
| 722 |
|
| 723 |
}); |
| 724 |
stopTimeoutSpinner.addModifyListener(new ModifyListener(){ |
| 725 |
public void modifyText(ModifyEvent e) { |
| 726 |
if (updating) |
| 727 |
return; |
| 728 |
updating = true; |
| 729 |
try { |
| 730 |
setSpinnerTooltip(stopTimeoutSpinner); |
| 731 |
execute(new SetServerStopTimeoutCommand(getServer(), stopTimeoutSpinner.getSelection())); |
| 732 |
} catch (Exception ex) { |
| 733 |
// ignore |
| 734 |
} |
| 735 |
updating = false; |
| 736 |
validate(); |
| 737 |
|
| 738 |
} |
| 739 |
}); |
| 740 |
} |
| 741 |
|
| 742 |
|
| 743 |
} |
| 744 |
|
| 745 |
|
| 746 |
protected void setSpinnerTooltip(Spinner spinner){ |
| 747 |
float miliSeconds = new Float(spinner.getSelection()).floatValue(); |
| 748 |
float seconds = miliSeconds / 1000f; |
| 749 |
|
| 750 |
if ( seconds < 60) { |
| 751 |
|
| 752 |
spinner.setToolTipText( seconds +" seconds"); |
| 753 |
return; |
| 754 |
} |
| 755 |
|
| 756 |
int minutes = new Float(seconds).intValue() / 60; |
| 757 |
spinner.setToolTipText( minutes +" minutes"); |
| 758 |
|
| 759 |
|
| 760 |
|
| 761 |
|
| 762 |
} |
| 647 |
protected void editRuntime(IRuntime runtime) { |
763 |
protected void editRuntime(IRuntime runtime) { |
| 648 |
IRuntimeWorkingCopy runtimeWorkingCopy = runtime.createWorkingCopy(); |
764 |
IRuntimeWorkingCopy runtimeWorkingCopy = runtime.createWorkingCopy(); |
| 649 |
if (showWizard(runtimeWorkingCopy) != Window.CANCEL) { |
765 |
if (showWizard(runtimeWorkingCopy) != Window.CANCEL) { |