Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 121593
Collapse All | Expand All

(-)serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java (+116 lines)
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) {
(-)serverui/org/eclipse/wst/server/ui/internal/Messages.java (+11 lines)
Lines 302-307 Link Here
302
	public static String serverEditorOverviewServerNameCommand;
302
	public static String serverEditorOverviewServerNameCommand;
303
	public static String serverEditorOverviewRuntimeCommand;
303
	public static String serverEditorOverviewRuntimeCommand;
304
	public static String serverEditorOverviewOpenLaunchConfiguration;
304
	public static String serverEditorOverviewOpenLaunchConfiguration;
305
	
306
	public static String serverEditorOverviewTimeoutSection;
307
	public static String serverEditorOverviewTimeoutDescription;	
308
	public static String serverEditorOverviewTimeoutCommand;
309
	
310
	public static String serverEditorOverviewStartTimeout;	
311
	public static String serverEditorOverviewStopTimeout;
312
	
313
	
314
	
305
	public static String errorMissingConfiguration;
315
	public static String errorMissingConfiguration;
306
	public static String viewStatusStarting4;
316
	public static String viewStatusStarting4;
307
	public static String viewStatusStarted2;
317
	public static String viewStatusStarted2;
Lines 359-364 Link Here
359
369
360
	public static String preferenceInternetDescription;
370
	public static String preferenceInternetDescription;
361
	public static String internalWebBrowserName;
371
	public static String internalWebBrowserName;
372
	
362
373
363
	static {
374
	static {
364
		NLS.initializeMessages(ServerUIPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
375
		NLS.initializeMessages(ServerUIPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
(-)serverui/org/eclipse/wst/server/ui/internal/ServerPreferencePage.java (-31 / +1 lines)
Lines 12-25 Link Here
12
12
13
import org.eclipse.jface.dialogs.Dialog;
13
import org.eclipse.jface.dialogs.Dialog;
14
import org.eclipse.jface.preference.PreferencePage;
14
import org.eclipse.jface.preference.PreferencePage;
15
import org.eclipse.wst.server.core.internal.ServerPreferences;
16
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.events.SelectionAdapter;
16
import org.eclipse.swt.events.SelectionAdapter;
18
import org.eclipse.swt.events.SelectionEvent;
17
import org.eclipse.swt.events.SelectionEvent;
19
import org.eclipse.swt.layout.GridData;
18
import org.eclipse.swt.layout.GridData;
20
import org.eclipse.swt.layout.GridLayout;
19
import org.eclipse.swt.layout.GridLayout;
21
import org.eclipse.swt.widgets.Button;
20
import org.eclipse.swt.widgets.Button;
22
import org.eclipse.swt.widgets.Combo;
23
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Composite;
24
import org.eclipse.swt.widgets.Control;
22
import org.eclipse.swt.widgets.Control;
25
import org.eclipse.swt.widgets.Label;
23
import org.eclipse.swt.widgets.Label;
Lines 28-33 Link Here
28
import org.eclipse.ui.IWorkbenchPreferencePage;
26
import org.eclipse.ui.IWorkbenchPreferencePage;
29
import org.eclipse.ui.PlatformUI;
27
import org.eclipse.ui.PlatformUI;
30
import org.eclipse.ui.help.IWorkbenchHelpSystem;
28
import org.eclipse.ui.help.IWorkbenchHelpSystem;
29
import org.eclipse.wst.server.core.internal.ServerPreferences;
31
/**
30
/**
32
 * The preference page that holds server properties.
31
 * The preference page that holds server properties.
33
 */
32
 */
Lines 45-52 Link Here
45
	protected Button autoPublishRemote;
44
	protected Button autoPublishRemote;
46
	protected Spinner autoPublishRemoteTime;
45
	protected Spinner autoPublishRemoteTime;
47
46
48
	protected Combo machineSpeedCombo;
49
50
	/**
47
	/**
51
	 * ServerPreferencesPage constructor comment.
48
	 * ServerPreferencesPage constructor comment.
52
	 */
49
	 */
Lines 169-194 Link Here
169
		label = new Label(composite, SWT.NONE);
166
		label = new Label(composite, SWT.NONE);
170
		label.setText(Messages.prefMachineSpeed);
167
		label.setText(Messages.prefMachineSpeed);
171
		
168
		
172
		machineSpeedCombo = new Combo(composite, SWT.READ_ONLY);
173
		String[] items = new String[] {
174
			Messages.prefMachineSpeedUnlimited,
175
			Messages.prefMachineSpeedVerySlow,
176
			Messages.prefMachineSpeedSlow,
177
			Messages.prefMachineSpeedAverage,
178
			Messages.prefMachineSpeedFast,
179
			Messages.prefMachineSpeedVeryFast
180
		};
181
		machineSpeedCombo.setItems(items);
182
		int speed = preferences.getMachineSpeed();
183
		if (speed < 0)
184
			machineSpeedCombo.select(0);
185
		else
186
			machineSpeedCombo.select((speed - 1) / 2 + 1);
187
		data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
188
		data.horizontalSpan = 2;
189
		machineSpeedCombo.setLayoutData(data);
190
		whs.setHelp(machineSpeedCombo, ContextIds.PREF_GENERAL_TIMEOUT_DELAY);
191
		
192
		Dialog.applyDialogFont(composite);
169
		Dialog.applyDialogFont(composite);
193
		
170
		
194
		return composite;
171
		return composite;
Lines 215-221 Link Here
215
		autoPublishRemote.setSelection(preferences.getDefaultAutoPublishRemote());
192
		autoPublishRemote.setSelection(preferences.getDefaultAutoPublishRemote());
216
		autoPublishRemoteTime.setSelection(preferences.getDefaultAutoPublishRemoteTime());
193
		autoPublishRemoteTime.setSelection(preferences.getDefaultAutoPublishRemoteTime());
217
		
194
		
218
		machineSpeedCombo.select((preferences.getDefaultMachineSpeed() - 1) / 2 + 1);
219
		
195
		
220
		super.performDefaults();
196
		super.performDefaults();
221
	}
197
	}
Lines 232-243 Link Here
232
		preferences.setAutoPublishRemote(autoPublishRemote.getSelection());
208
		preferences.setAutoPublishRemote(autoPublishRemote.getSelection());
233
		preferences.setAutoPublishRemoteTime(autoPublishRemoteTime.getSelection());
209
		preferences.setAutoPublishRemoteTime(autoPublishRemoteTime.getSelection());
234
		
210
		
235
		int speed = machineSpeedCombo.getSelectionIndex();
236
		if (speed == 0)
237
			speed = -1;
238
		else
239
			speed = (speed - 1) * 2 + 1;
240
		preferences.setMachineSpeed(speed);
241
		
211
		
242
		return true;
212
		return true;
243
	}
213
	}
(-)serverui/org/eclipse/wst/server/ui/internal/Messages.properties (-1 / +10 lines)
Lines 444-450 Link Here
444
serverEditorOverviewRuntimeCommand=set runtime
444
serverEditorOverviewRuntimeCommand=set runtime
445
445
446
serverEditorOverviewAutoPublishSection=Automatic Publishing
446
serverEditorOverviewAutoPublishSection=Automatic Publishing
447
serverEditorOverviewAutoPublishDescription=Override when the server is automatically published to.
447
serverEditorOverviewAutoPublishDescription=Override when the server is automatically published.
448
serverEditorOverviewAutoPublishDefault=Use default publishing settings
448
serverEditorOverviewAutoPublishDefault=Use default publishing settings
449
serverEditorOverviewAutoPublishDefaultEdit=Edit
449
serverEditorOverviewAutoPublishDefaultEdit=Edit
450
serverEditorOverviewAutoPublishOverride=Override default settings
450
serverEditorOverviewAutoPublishOverride=Override default settings
Lines 454-459 Link Here
454
serverEditorOverviewOpenLaunchConfiguration=Open launch configuration
454
serverEditorOverviewOpenLaunchConfiguration=Open launch configuration
455
serverEditorOverviewAutoPublishInvalid=The automatic publish setting is invalid. It must be a 1 second or more.
455
serverEditorOverviewAutoPublishInvalid=The automatic publish setting is invalid. It must be a 1 second or more.
456
456
457
serverEditorOverviewTimeoutSection=Timeouts intervals
458
serverEditorOverviewTimeoutDescription=Specify the time to wait until the server state is received 
459
serverEditorOverviewStartTimeout=Start
460
serverEditorOverviewStopTimeout=Stop
461
serverEditorOverviewTimeoutCommand=modify timeout settings
462
463
464
465
457
# Menu items. {0} will be replaced by one of the xxxEditorActionXxx fields
466
# Menu items. {0} will be replaced by one of the xxxEditorActionXxx fields
458
# from below. @Ctrl+Z is the menu mnemonic
467
# from below. @Ctrl+Z is the menu mnemonic
459
editorUndoEnabled=Undo {0}@Ctrl+Z
468
editorUndoEnabled=Undo {0}@Ctrl+Z
(-)serverui/org/eclipse/wst/server/ui/internal/command/SetServerStopTimeoutCommand.java (+50 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.server.ui.internal.command;
12
13
import org.eclipse.wst.server.core.IServerWorkingCopy;
14
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
15
import org.eclipse.wst.server.ui.internal.Messages;
16
/**
17
 * Command to change the server's auto-publish setting.
18
 */
19
public class SetServerStopTimeoutCommand extends ServerCommand {
20
	protected int time;
21
	protected int oldTime;
22
23
	/**
24
	 * SetServerAutoPublishDefaultCommand constructor.
25
	 * 
26
	 * @param server a server
27
	 * @param time a publish time
28
	 */
29
	public SetServerStopTimeoutCommand(IServerWorkingCopy server, int time) {
30
		super(server, Messages.serverEditorOverviewTimeoutCommand);
31
		this.time = time;
32
	}
33
34
	/**
35
	 * Execute the command.
36
	 */
37
	public void execute() {
38
		ServerWorkingCopy swc = (ServerWorkingCopy) server;
39
		oldTime = swc.getStopTimoutSetting();
40
		swc.setStopTimeout(time);
41
	}
42
43
	/**
44
	 * Undo the command.
45
	 */
46
	public void undo() {
47
		ServerWorkingCopy swc = (ServerWorkingCopy) server;
48
		swc.setStopTimeout(oldTime);
49
	}
50
}
(-)serverui/org/eclipse/wst/server/ui/internal/command/SetServerStartTimeoutCommand.java (+50 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - Initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.server.ui.internal.command;
12
13
import org.eclipse.wst.server.core.IServerWorkingCopy;
14
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
15
import org.eclipse.wst.server.ui.internal.Messages;
16
/**
17
 * Command to change the server's auto-publish setting.
18
 */
19
public class SetServerStartTimeoutCommand extends ServerCommand {
20
	protected int time;
21
	protected int oldTime;
22
23
	/**
24
	 * SetServerAutoPublishDefaultCommand constructor.
25
	 * 
26
	 * @param server a server
27
	 * @param time a publish time
28
	 */
29
	public SetServerStartTimeoutCommand(IServerWorkingCopy server, int time) {
30
		super(server, Messages.serverEditorOverviewTimeoutCommand);
31
		this.time = time;
32
	}
33
34
	/**
35
	 * Execute the command.
36
	 */
37
	public void execute() {
38
		ServerWorkingCopy swc = (ServerWorkingCopy) server;
39
		oldTime = swc.getStartTimeoutSetting();
40
		swc.setStartTimeout(time);
41
	}
42
43
	/**
44
	 * Undo the command.
45
	 */
46
	public void undo() {
47
		ServerWorkingCopy swc = (ServerWorkingCopy) server;
48
		swc.setStartTimeout(oldTime);
49
	}
50
}
(-)servercore/org/eclipse/wst/server/core/internal/Server.java (-2 / +15 lines)
Lines 70-75 Link Here
70
	protected static final String PROP_ENABLED_OPTIONAL_TASKS = "enabled-optional-publish-tasks";
70
	protected static final String PROP_ENABLED_OPTIONAL_TASKS = "enabled-optional-publish-tasks";
71
	public static final String PROP_AUTO_PUBLISH_TIME = "auto-publish-time";
71
	public static final String PROP_AUTO_PUBLISH_TIME = "auto-publish-time";
72
	public static final String PROP_AUTO_PUBLISH_SETTING = "auto-publish-setting";
72
	public static final String PROP_AUTO_PUBLISH_SETTING = "auto-publish-setting";
73
	public static final String PROP_START_TIMEOUT = "start-timeout";
74
	public static final String PROP_STOP_TIMEOUT = "stop-timeout";	
73
75
74
	protected static final char[] INVALID_CHARS = new char[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
76
	protected static final char[] INVALID_CHARS = new char[] {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
75
77
Lines 233-238 Link Here
233
		this.serverType = serverType;
235
		this.serverType = serverType;
234
		map.put("server-type-id", serverType.getId());
236
		map.put("server-type-id", serverType.getId());
235
		map.put(PROP_HOSTNAME, "localhost");
237
		map.put(PROP_HOSTNAME, "localhost");
238
		map.put(PROP_START_TIMEOUT, ((ServerType)serverType).getStartTimeout() );
239
		map.put(PROP_STOP_TIMEOUT, ((ServerType)serverType).getStopTimeout() );
236
		if (runtime != null && runtime.getRuntimeType() != null) {
240
		if (runtime != null && runtime.getRuntimeType() != null) {
237
			String name = runtime.getRuntimeType().getName();
241
			String name = runtime.getRuntimeType().getName();
238
			map.put(PROP_NAME, name);
242
			map.put(PROP_NAME, name);
Lines 352-357 Link Here
352
	public int getAutoPublishSetting() {
356
	public int getAutoPublishSetting() {
353
		return getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_DEFAULT);
357
		return getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_DEFAULT);
354
	}
358
	}
359
	
360
	public int getStartTimeoutSetting() {
361
		return getAttribute(PROP_START_TIMEOUT, ((ServerType)getServerType()).getStartTimeout());
362
	}
363
	
364
	public int getStopTimoutSetting() {
365
		return getAttribute(PROP_STOP_TIMEOUT, ((ServerType)getServerType()).getStopTimeout());
366
	}
367
	
355
368
356
	/**
369
	/**
357
    * Returns a list of id (String) of preferred publish operations that will not be run
370
    * Returns a list of id (String) of preferred publish operations that will not be run
Lines 1537-1543 Link Here
1537
		addServerListener(listener);
1550
		addServerListener(listener);
1538
		
1551
		
1539
		// add timeout thread
1552
		// add timeout thread
1540
		final int serverTimeout = ((ServerType) getServerType()).getStartTimeout();
1553
		final int serverTimeout = getStartTimeoutSetting();
1541
		if (serverTimeout > 0) {
1554
		if (serverTimeout > 0) {
1542
			Thread thread = new Thread("Server start timeout") {
1555
			Thread thread = new Thread("Server start timeout") {
1543
				public void run() {
1556
				public void run() {
Lines 1846-1852 Link Here
1846
		operation.listener = listener;
1859
		operation.listener = listener;
1847
		addServerListener(listener);
1860
		addServerListener(listener);
1848
		
1861
		
1849
		final int serverTimeout = ((ServerType) getServerType()).getStopTimeout();
1862
		final int serverTimeout = getStopTimoutSetting();
1850
		if (serverTimeout > 0) {
1863
		if (serverTimeout > 0) {
1851
			Thread thread = new Thread("Server stop timeout") {
1864
			Thread thread = new Thread("Server stop timeout") {
1852
				public void run() {
1865
				public void run() {
(-)servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java (+8 lines)
Lines 227-232 Link Here
227
	public void setAutoPublishTime(int p) {
227
	public void setAutoPublishTime(int p) {
228
		setAttribute(PROP_AUTO_PUBLISH_TIME, p);
228
		setAttribute(PROP_AUTO_PUBLISH_TIME, p);
229
	}
229
	}
230
	
231
	public void setStartTimeout(int p) {
232
		setAttribute(PROP_START_TIMEOUT, p);
233
	}
234
	
235
	public void setStopTimeout(int p) {
236
		setAttribute(PROP_STOP_TIMEOUT, p);
237
	}
230
238
231
	public void setAutoPublishSetting(int s) {
239
	public void setAutoPublishSetting(int s) {
232
		setAttribute(PROP_AUTO_PUBLISH_SETTING, s);
240
		setAttribute(PROP_AUTO_PUBLISH_SETTING, s);
(-)servercore/org/eclipse/wst/server/core/internal/ServerType.java (-10 / +2 lines)
Lines 29-36 Link Here
29
 */
29
 */
30
public class ServerType implements IServerType {
30
public class ServerType implements IServerType {
31
	private static final int DEFAULT_TIMEOUT = 1000 * 60 * 4; // 4 minutes
31
	private static final int DEFAULT_TIMEOUT = 1000 * 60 * 4; // 4 minutes
32
	private static final float[] SERVER_TIMEOUTS =
33
		new float[] { 4f, 3f, 2f, 1.5f, 1f, 0.75f, 0.5f, 0.35f, 0.25f };
34
	private IConfigurationElement element;
32
	private IConfigurationElement element;
35
33
36
	/**
34
	/**
Lines 306-315 Link Here
306
	public int getStartTimeout() {
304
	public int getStartTimeout() {
307
		try {
305
		try {
308
			int i = Integer.parseInt(element.getAttribute("startTimeout"));
306
			int i = Integer.parseInt(element.getAttribute("startTimeout"));
309
			int s = ServerPreferences.getInstance().getMachineSpeed();
307
			return i;
310
			if (s < 0)
311
				return -1;
312
			return (int) (i * SERVER_TIMEOUTS[s-1]);
313
		} catch (NumberFormatException e) {
308
		} catch (NumberFormatException e) {
314
			// ignore
309
			// ignore
315
		}
310
		}
Lines 325-334 Link Here
325
	public int getStopTimeout() {
320
	public int getStopTimeout() {
326
		try {
321
		try {
327
			int i = Integer.parseInt(element.getAttribute("stopTimeout"));
322
			int i = Integer.parseInt(element.getAttribute("stopTimeout"));
328
			int s = ServerPreferences.getInstance().getMachineSpeed();
323
			return i;
329
			if (s < 0)
330
				return -1;
331
			return (int) (i * SERVER_TIMEOUTS[s-1]);
332
		} catch (NumberFormatException e) {
324
		} catch (NumberFormatException e) {
333
			// ignore
325
			// ignore
334
		}
326
		}

Return to bug 121593