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 199594 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/platform/common/ui/trace/internal/CommonUITracePlugin.java (-1 / +1 lines)
Lines 89-95 Link Here
89
	{		
89
	{		
90
		/* Default hosts */
90
		/* Default hosts */
91
		store.setDefault(CommonUIConstants.HOST_KEY,"localhost:10002");
91
		store.setDefault(CommonUIConstants.HOST_KEY,"localhost:10002");
92
		store.setDefault(CommonUIConstants.LOCALHOST_PORT, "10002");
92
//		store.setDefault(CommonUIConstants.LOCALHOST_PORT, "10002");
93
		
93
		
94
		/* Trace options */
94
		/* Trace options */
95
		store.setDefault(CommonUITraceConstants.TRACE_PROJECT_NAME, CommonUITraceMessages.TRC_LOCD);
95
		store.setDefault(CommonUITraceConstants.TRACE_PROJECT_NAME, CommonUITraceMessages.TRC_LOCD);
(-)plugin.xml (-1 / +1 lines)
Lines 29-35 Link Here
29
	<extension point="org.eclipse.ui.preferencePages">
29
	<extension point="org.eclipse.ui.preferencePages">
30
		<page
30
		<page
31
			name="%P_NODEP"
31
			name="%P_NODEP"
32
            category="org.eclipse.hyades.trace.ui.internal.preferences.TraceBasePreferencePage"
32
            category="org.eclipse.hyades.security.internal.preference.ACPreferencePage"
33
            class="org.eclipse.hyades.trace.ui.internal.preferences.HostPreferencePage"
33
            class="org.eclipse.hyades.trace.ui.internal.preferences.HostPreferencePage"
34
            id="org.eclipse.hyades.trace.ui.internal.preferences.HostPreferencePage">
34
            id="org.eclipse.hyades.trace.ui.internal.preferences.HostPreferencePage">
35
		</page>     
35
		</page>     
(-)src/org/eclipse/hyades/security/internal/preference/ACPreferencePage.java (-4 / +145 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 12-28 Link Here
12
12
13
package org.eclipse.hyades.security.internal.preference;
13
package org.eclipse.hyades.security.internal.preference;
14
14
15
import org.eclipse.hyades.ui.HyadesUIPlugin;
16
import org.eclipse.hyades.ui.util.GridUtil;
15
import org.eclipse.jface.dialogs.Dialog;
17
import org.eclipse.jface.dialogs.Dialog;
18
import org.eclipse.jface.preference.IPreferenceStore;
16
import org.eclipse.jface.preference.PreferencePage;
19
import org.eclipse.jface.preference.PreferencePage;
17
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.events.ModifyEvent;
22
import org.eclipse.swt.events.ModifyListener;
23
import org.eclipse.swt.layout.GridData;
24
import org.eclipse.swt.layout.GridLayout;
18
import org.eclipse.swt.widgets.Composite;
25
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.swt.widgets.Control;
26
import org.eclipse.swt.widgets.Control;
27
import org.eclipse.swt.widgets.Group;
28
import org.eclipse.swt.widgets.Label;
29
import org.eclipse.swt.widgets.Text;
30
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
20
import org.eclipse.ui.IWorkbench;
31
import org.eclipse.ui.IWorkbench;
21
import org.eclipse.ui.IWorkbenchPreferencePage;
32
import org.eclipse.ui.IWorkbenchPreferencePage;
33
import org.eclipse.ui.PlatformUI;
22
34
23
public class ACPreferencePage extends PreferencePage
35
public class ACPreferencePage extends PreferencePage
24
	implements IWorkbenchPreferencePage {
36
	implements IWorkbenchPreferencePage, ModifyListener {
25
	
37
	
38
	private IPreferenceStore store = HyadesUIPlugin.getInstance().getPreferenceStore(); 
39
	private Text _localPort;
40
    
41
    
42
	public Composite createControls(Composite parent)
43
	{
44
		GridLayout layout;
45
		GridData data;
46
		
47
		Composite content = new Composite(parent, SWT.NONE);
48
		layout = new GridLayout();
49
		layout.numColumns = 1;
50
		layout.verticalSpacing = 10;
51
		content.setLayout(layout);
52
		content.setLayoutData(GridUtil.createFill()); 
53
		
54
		Group profilingInfo = new Group(content, SWT.NULL);
55
		profilingInfo.setText(ACPrefMessages._1);	
56
		layout = new GridLayout();
57
		layout.numColumns = 2;
58
		profilingInfo.setLayout(layout);
59
		profilingInfo.setLayoutData(GridUtil.createHorizontalFill());
60
		
61
		Label portdesc = new Label(profilingInfo, SWT.NULL);
62
		portdesc.setText(ACPrefMessages._2);
63
		_localPort = new Text(profilingInfo, SWT.BORDER);
64
		data = GridUtil.createHorizontalFill();
65
		_localPort.setLayoutData(data);
66
		_localPort.addModifyListener(this);
67
		
68
		initializeValues();
69
		
70
		Dialog.applyDialogFont( content );
71
		
72
		return content;  
73
	}
74
	
75
	private void initializeValues()
76
	{
77
		store = HyadesUIPlugin.getInstance().getPreferenceStore();
78
		setLocalHostPort(store.getString(CommonUIConstants.LOCALHOST_PORT));
79
	}
80
81
82
	public String getLocalPortNumber() {
83
		return _localPort.getText().trim();
84
	}
85
	
86
	public void setLocalHostPort(String portNum)
87
	{
88
		_localPort.setText(portNum);
89
	}
90
	
91
	public void modifyText(ModifyEvent e)
92
	{
93
		if (e.widget == _localPort)
94
		{
95
			try
96
			{
97
				if (_localPort.getText().trim() == "")
98
				{
99
					setErrorMessage(ACPrefMessages._3);
100
					return;
101
				}
102
				
103
				int value = Integer.parseInt(_localPort.getText().trim());
104
				if (value<0)
105
				{
106
					setErrorMessage(ACPrefMessages._4);
107
					_localPort.setFocus();
108
					return;
109
				}
110
				setErrorMessage(null);
111
			}
112
			catch (NumberFormatException nfe)
113
			{
114
				if (this != null)
115
					setErrorMessage(ACPrefMessages._4);
116
					_localPort.setFocus();
117
			}
118
		}
119
	}
120
26
	/* (non-Javadoc)
121
	/* (non-Javadoc)
27
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
122
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
28
	 */
123
	 */
Lines 30-41 Link Here
30
        // Do nothing
125
        // Do nothing
31
	}
126
	}
32
127
33
	protected Control createContents(Composite parent) {
128
	public Control createContents(Composite parent) {
129
34
		Composite comp = new Composite( parent, SWT.NONE );
130
		Composite comp = new Composite( parent, SWT.NONE );
35
		
131
		
132
		PlatformUI.getWorkbench().getHelpSystem().setHelp(
133
				parent,
134
				HyadesUIPlugin.getID()+".tbpp0000");
135
				
136
		GridLayout layout= new GridLayout();
137
		layout.marginWidth= 0;
138
		layout.marginHeight= 5;	
139
		layout.numColumns= 1;		
140
		comp.setLayout(layout);
141
		
142
		createControls(comp);
143
36
		Dialog.applyDialogFont( comp );
144
		Dialog.applyDialogFont( comp );
37
		
145
		
38
		return comp;
146
		return comp;
39
	}
147
	}
40
148
	
149
	/**
150
	 * Initializes states of the controls using default values
151
	 * in the preference store.
152
	 */
153
	private void initializeDefaults()
154
	{
155
		setLocalHostPort(store.getDefaultString(CommonUIConstants.LOCALHOST_PORT));
156
	}
157
	/**
158
	 * Does anything necessary because the default button has been pressed.
159
	 */
160
	protected void performDefaults() {
161
		initializeDefaults();
162
	}
163
	/**
164
	 * Do anything necessary because the OK button has been pressed.
165
	 *
166
	 * @return whether it is okay to close the preference page
167
	 */
168
	public boolean performOk() {
169
		storeValues();
170
		HyadesUIPlugin.getInstance().savePluginPreferences();
171
		return true;
172
	}
173
	
174
	/**
175
	 * Stores the values of the controls back to the preference store.
176
	 */
177
	private void storeValues()
178
	{		
179
		store.setValue(CommonUIConstants.LOCALHOST_PORT, this.getLocalPortNumber());	
180
	}
41
}
181
}
182
(-)src/org/eclipse/hyades/ui/HyadesUIPlugin.java (-2 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials 
3
 * All rights reserved. This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 23-30 Link Here
23
import org.eclipse.hyades.ui.internal.logicalfolder.LogicalFolder;
23
import org.eclipse.hyades.ui.internal.logicalfolder.LogicalFolder;
24
import org.eclipse.hyades.ui.internal.util.ResourceBundleManager;
24
import org.eclipse.hyades.ui.internal.util.ResourceBundleManager;
25
import org.eclipse.hyades.ui.util.ILogger;
25
import org.eclipse.hyades.ui.util.ILogger;
26
import org.eclipse.jface.preference.IPreferenceStore;
26
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.tptp.platform.common.internal.CommonPlugin;
28
import org.eclipse.tptp.platform.common.internal.CommonPlugin;
29
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
28
import org.eclipse.ui.plugin.AbstractUIPlugin;
30
import org.eclipse.ui.plugin.AbstractUIPlugin;
29
import org.osgi.framework.BundleContext;
31
import org.osgi.framework.BundleContext;
30
32
Lines 96-101 Link Here
96
		return instance;
98
		return instance;
97
	}
99
	}
98
	
100
	
101
	protected void initializePreferences() 
102
	{		
103
		/* Default host */
104
		IPreferenceStore store = getPreferenceStore(); 
105
		store.setDefault(CommonUIConstants.LOCALHOST_PORT, "10002");
106
	}
99
	
107
	
100
	/**
108
	/**
101
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
109
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
Lines 131-137 Link Here
131
			Display.getDefault().asyncExec(operation);
139
			Display.getDefault().asyncExec(operation);
132
		}
140
		}
133
		
141
		
134
		restoreFilterSelections();		
142
		restoreFilterSelections();	
143
		
144
		initializePreferences(); 
135
	}		
145
	}		
136
	
146
	
137
	/**
147
	/**
(-)src/org/eclipse/hyades/security/internal/preference/ACPrefMessages.java (+34 lines)
Added Link Here
1
/**********************************************************************
2
 * Copyright (c) 2008 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
 * $Id: ACPrefMessages.java,v 1.0 2008/04/04 17:20:37 ritwikl Exp $
8
 * 
9
 * Contributors: 
10
 * IBM - Initial API and implementation
11
 **********************************************************************/
12
13
package org.eclipse.hyades.security.internal.preference;
14
15
import org.eclipse.osgi.util.NLS;
16
17
public class ACPrefMessages extends NLS {
18
	protected static final String BUNDLE_NAME = "org.eclipse.hyades.security.internal.preference.ACMessages"; //$NON-NLS-1$
19
	
20
	protected ACPrefMessages() {
21
	}
22
23
	static {
24
		// initialize resource bundle
25
		NLS.initializeMessages(BUNDLE_NAME, ACPrefMessages.class);
26
	}
27
	
28
	public static String _1;
29
	public static String _2;
30
	
31
	public static String _3;
32
	public static String _4;
33
34
}
(-)src/org/eclipse/hyades/security/internal/preference/ACMessages.properties (+17 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2008 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
# $Id: ACMessages.properties,v 1.0 2008/04/04 17:22:31 ritwikl Exp $
8
#
9
# Contributors:
10
# IBM Corporation - initial API and implementation
11
###############################################################################
12
13
_1 = Agent Controller Preferences 
14
_2 = Agent Controller local port: 
15
	
16
_3 = Agent Controller port cannot be empty
17
_4 = Invalid port number for Agent Controller
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/launcher/AgentAvailibilityTester.java (-1 / +2 lines)
Lines 16-21 Link Here
16
import org.eclipse.debug.core.ILaunchConfiguration;
16
import org.eclipse.debug.core.ILaunchConfiguration;
17
import org.eclipse.hyades.trace.ui.UIPlugin;
17
import org.eclipse.hyades.trace.ui.UIPlugin;
18
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
18
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
19
import org.eclipse.hyades.ui.HyadesUIPlugin;
19
import org.eclipse.jface.preference.IPreferenceStore;
20
import org.eclipse.jface.preference.IPreferenceStore;
20
import org.eclipse.osgi.util.NLS;
21
import org.eclipse.osgi.util.NLS;
21
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
22
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
Lines 78-84 Link Here
78
			/* Determine the port number from the preference page if it's not stored as part of the configuration */
79
			/* Determine the port number from the preference page if it's not stored as part of the configuration */
79
			if (port == -1)
80
			if (port == -1)
80
			{
81
			{
81
				IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();					
82
				IPreferenceStore store = HyadesUIPlugin.getInstance().getPreferenceStore();					
82
				port = store.getInt(CommonUIConstants.LOCALHOST_PORT);
83
				port = store.getInt(CommonUIConstants.LOCALHOST_PORT);
83
			}
84
			}
84
		} catch (CoreException e)
85
		} catch (CoreException e)
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/launcher/TIAttachLauncherDelegate.java (-1 / +2 lines)
Lines 22-27 Link Here
22
import org.eclipse.hyades.trace.ui.UIPlugin;
22
import org.eclipse.hyades.trace.ui.UIPlugin;
23
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
23
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
24
import org.eclipse.hyades.trace.ui.internal.launcher.SelectedAgent;
24
import org.eclipse.hyades.trace.ui.internal.launcher.SelectedAgent;
25
import org.eclipse.hyades.ui.HyadesUIPlugin;
25
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
26
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
26
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
27
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
27
import org.eclipse.tptp.platform.execution.client.agent.IAgent;
28
import org.eclipse.tptp.platform.execution.client.agent.IAgent;
Lines 83-89 Link Here
83
	public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException
84
	public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException
84
	{		
85
	{		
85
		String hostName = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
86
		String hostName = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
86
		int port = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, UIPlugin.getDefault().getPreferenceStore().getDefaultInt(CommonUIConstants.LOCALHOST_PORT));
87
		int port = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, HyadesUIPlugin.getInstance().getPreferenceStore().getDefaultInt(CommonUIConstants.LOCALHOST_PORT));
87
		
88
		
88
		try
89
		try
89
		{
90
		{
(-)src/org/eclipse/tptp/platform/profile/server/core/internal/ProfileOnServerAdapter.java (-1 / +2 lines)
Lines 26-31 Link Here
26
import org.eclipse.hyades.trace.ui.internal.launcher.AttachDelegate;
26
import org.eclipse.hyades.trace.ui.internal.launcher.AttachDelegate;
27
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
27
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
28
import org.eclipse.hyades.trace.ui.internal.util.PDCoreUtil;
28
import org.eclipse.hyades.trace.ui.internal.util.PDCoreUtil;
29
import org.eclipse.hyades.ui.HyadesUIPlugin;
29
import org.eclipse.jface.dialogs.Dialog;
30
import org.eclipse.jface.dialogs.Dialog;
30
import org.eclipse.jface.wizard.WizardDialog;
31
import org.eclipse.jface.wizard.WizardDialog;
31
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
32
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
Lines 57-63 Link Here
57
        	}
58
        	}
58
        	
59
        	
59
        	/* get port number */
60
        	/* get port number */
60
            int port = wc.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, UIPlugin.getDefault().getPreferenceStore().getInt(CommonUIConstants.LOCALHOST_PORT));
61
            int port = wc.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, HyadesUIPlugin.getInstance().getPreferenceStore().getInt(CommonUIConstants.LOCALHOST_PORT));
61
        	
62
        	
62
            /* set host and port attribute of launch configuration */
63
            /* set host and port attribute of launch configuration */
63
            wc.setAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, hostname);
64
            wc.setAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, hostname);
(-).project (+11 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.eclipse.tptp.platform.lta.extensions.instances</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
	</buildSpec>
9
	<natures>
10
	</natures>
11
</projectDescription>
(-)src/org/eclipse/hyades/trace/ui/internal/core/TraceOptionsUI.java (-52 / +2 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 22-29 Link Here
22
import org.eclipse.jface.preference.IPreferenceStore;
22
import org.eclipse.jface.preference.IPreferenceStore;
23
import org.eclipse.jface.preference.PreferencePage;
23
import org.eclipse.jface.preference.PreferencePage;
24
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.events.ModifyEvent;
26
import org.eclipse.swt.events.ModifyListener;
27
import org.eclipse.swt.events.SelectionEvent;
25
import org.eclipse.swt.events.SelectionEvent;
28
import org.eclipse.swt.events.SelectionListener;
26
import org.eclipse.swt.events.SelectionListener;
29
import org.eclipse.swt.layout.GridData;
27
import org.eclipse.swt.layout.GridData;
Lines 33-39 Link Here
33
import org.eclipse.swt.widgets.Group;
31
import org.eclipse.swt.widgets.Group;
34
import org.eclipse.swt.widgets.Label;
32
import org.eclipse.swt.widgets.Label;
35
import org.eclipse.swt.widgets.Text;
33
import org.eclipse.swt.widgets.Text;
36
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
37
import org.eclipse.tptp.platform.common.ui.internal.CommonUIPlugin;
34
import org.eclipse.tptp.platform.common.ui.internal.CommonUIPlugin;
38
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
35
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
39
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITracePlugin;
36
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITracePlugin;
Lines 57-63 Link Here
57
* CONTEXT_ID tbpp0006 for Local IBM Remote Agent port number entry field in Profiling(Trace) preference page
54
* CONTEXT_ID tbpp0006 for Local IBM Remote Agent port number entry field in Profiling(Trace) preference page
58
*/
55
*/
59
56
60
public class TraceOptionsUI implements SelectionListener, ModifyListener
57
public class TraceOptionsUI implements SelectionListener 
61
{
58
{
62
	private Button _enableInfoMsg;
59
	private Button _enableInfoMsg;
63
	private Button _enableReloadMsg;
60
	private Button _enableReloadMsg;
Lines 68-74 Link Here
68
	private Button _neverPersp;
65
	private Button _neverPersp;
69
	private Button _promptPersp;
66
	private Button _promptPersp;
70
	private Text _projectName;
67
	private Text _projectName;
71
	private Text _localPort;
72
    private PreferencePage _preferencePage;
68
    private PreferencePage _preferencePage;
73
    
69
    
74
    private Button _manualRefreshBtn;
70
    private Button _manualRefreshBtn;
Lines 118-130 Link Here
118
	data = GridUtil.createHorizontalFill();
114
	data = GridUtil.createHorizontalFill();
119
	_projectName.setLayoutData(data);
115
	_projectName.setLayoutData(data);
120
116
121
	Label portdesc = new Label(profilingInfo, SWT.NULL);
122
	portdesc.setText(UIPlugin.getResourceString(TraceMessages.RAC_LHP));
123
	_localPort = new Text(profilingInfo, SWT.BORDER);
124
	data = GridUtil.createHorizontalFill();
125
	_localPort.setLayoutData(data);
126
	_localPort.addModifyListener(this);
127
128
	_enableInfoMsg = new Button(profilingInfo, SWT.CHECK);
117
	_enableInfoMsg = new Button(profilingInfo, SWT.CHECK);
129
	_enableInfoMsg.setText(UIPlugin.getResourceString(TraceMessages.SP_TIP));
118
	_enableInfoMsg.setText(UIPlugin.getResourceString(TraceMessages.SP_TIP));
130
	data = new GridData();
119
	data = new GridData();
Lines 259-268 Link Here
259
	return _projectName.getText().trim();
248
	return _projectName.getText().trim();
260
}
249
}
261
250
262
public String getLocalPortNumber() {
263
	return _localPort.getText().trim();
264
}
265
266
public String getSaveOnExitOption() {
251
public String getSaveOnExitOption() {
267
	if (_always.getSelection()) {
252
	if (_always.getSelection()) {
268
		return MessageDialogWithToggle.ALWAYS;
253
		return MessageDialogWithToggle.ALWAYS;
Lines 295-301 Link Here
295
	IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();
280
	IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();
296
281
297
	setProjectName(store.getString(CommonUITraceConstants.TRACE_PROJECT_NAME));		
282
	setProjectName(store.getString(CommonUITraceConstants.TRACE_PROJECT_NAME));		
298
	setLocalHostPort(store.getString(CommonUIConstants.LOCALHOST_PORT));
299
	setInfoMsgOption(store.getBoolean(TraceConstants.PROFILE_TIPS));
283
	setInfoMsgOption(store.getBoolean(TraceConstants.PROFILE_TIPS));
300
	setReloadMsgOption(store.getBoolean(CommonUITraceConstants.RELOAD_INFO));
284
	setReloadMsgOption(store.getBoolean(CommonUITraceConstants.RELOAD_INFO));
301
	/* Navid Mehregani - bugzilla_158635: The SAVE_ON_EXIT_KEY option should be read and stored in the preference store of CommonUITracePlugin */ 
285
	/* Navid Mehregani - bugzilla_158635: The SAVE_ON_EXIT_KEY option should be read and stored in the preference store of CommonUITracePlugin */ 
Lines 352-362 Link Here
352
	_projectName.setText(name);
336
	_projectName.setText(name);
353
}
337
}
354
338
355
public void setLocalHostPort(String portNum)
356
{
357
	_localPort.setText(portNum);
358
}
359
360
public void setSaveOnExitOption(String value) {
339
public void setSaveOnExitOption(String value) {
361
	if (MessageDialogWithToggle.ALWAYS.equals(value)) {
340
	if (MessageDialogWithToggle.ALWAYS.equals(value)) {
362
		_always.setSelection(true);
341
		_always.setSelection(true);
Lines 422-454 Link Here
422
   }
401
   }
423
}
402
}
424
403
425
public void modifyText(ModifyEvent e)
426
{
427
	if (e.widget == _localPort)
428
	{
429
		try
430
		{
431
			if (_localPort.getText().trim() == "")
432
			{
433
				_preferencePage.setErrorMessage(UIPlugin.getResourceString(TraceMessages.RAC_EMPTY_PORT));
434
				return;
435
			}
436
			
437
			int value = Integer.parseInt(_localPort.getText().trim());
438
			if (value<0)
439
			{
440
				_preferencePage.setErrorMessage(UIPlugin.getResourceString(TraceMessages.RAC_INV_PRT));
441
				_localPort.setFocus();
442
				return;
443
			}
444
			_preferencePage.setErrorMessage(null);
445
		}
446
		catch (NumberFormatException nfe)
447
		{
448
			if (_preferencePage != null)
449
				_preferencePage.setErrorMessage(UIPlugin.getResourceString(TraceMessages.RAC_INV_PRT));
450
				_localPort.setFocus();
451
		}
452
	}
453
}
454
}
404
}
(-)src/org/eclipse/hyades/trace/ui/internal/core/TraceProfileUI.java (-1 / +2 lines)
Lines 32-37 Link Here
32
import org.eclipse.hyades.trace.ui.internal.util.TraceMessages;
32
import org.eclipse.hyades.trace.ui.internal.util.TraceMessages;
33
import org.eclipse.hyades.trace.ui.launcher.IProfilingSetType;
33
import org.eclipse.hyades.trace.ui.launcher.IProfilingSetType;
34
import org.eclipse.hyades.trace.ui.launcher.ProfilingSetsManagerCopy;
34
import org.eclipse.hyades.trace.ui.launcher.ProfilingSetsManagerCopy;
35
import org.eclipse.hyades.ui.HyadesUIPlugin;
35
import org.eclipse.jface.viewers.CheckStateChangedEvent;
36
import org.eclipse.jface.viewers.CheckStateChangedEvent;
36
import org.eclipse.jface.viewers.CheckboxTreeViewer;
37
import org.eclipse.jface.viewers.CheckboxTreeViewer;
37
import org.eclipse.jface.viewers.DoubleClickEvent;
38
import org.eclipse.jface.viewers.DoubleClickEvent;
Lines 568-574 Link Here
568
		try
569
		try
569
		{
570
		{
570
			String currentHost = conf.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
571
			String currentHost = conf.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
571
			int currentPort = conf.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, UIPlugin.getDefault().getPreferenceStore().getDefaultInt(CommonUIConstants.LOCALHOST_PORT));
572
			int currentPort = conf.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, HyadesUIPlugin.getInstance().getPreferenceStore().getDefaultInt(CommonUIConstants.LOCALHOST_PORT));
572
			
573
			
573
			
574
			
574
			ConnectUtil connect = new ConnectUtil( currentHost, ""+currentPort,null);
575
			ConnectUtil connect = new ConnectUtil( currentHost, ""+currentPort,null);
(-)src/org/eclipse/hyades/trace/ui/internal/preferences/TraceBasePreferencePage.java (-6 / +2 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 23-29 Link Here
23
import org.eclipse.swt.layout.GridLayout;
23
import org.eclipse.swt.layout.GridLayout;
24
import org.eclipse.swt.widgets.Composite;
24
import org.eclipse.swt.widgets.Composite;
25
import org.eclipse.swt.widgets.Control;
25
import org.eclipse.swt.widgets.Control;
26
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
27
import org.eclipse.tptp.platform.common.ui.internal.CommonUIPlugin;
26
import org.eclipse.tptp.platform.common.ui.internal.CommonUIPlugin;
28
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
27
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
29
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITracePlugin;
28
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITracePlugin;
Lines 89-95 Link Here
89
 */
88
 */
90
private void initializeDefaults()
89
private void initializeDefaults()
91
{
90
{
92
	IPreferenceStore store = getPreferenceStore();
91
  	IPreferenceStore store = getPreferenceStore();
93
92
94
	_options.setInfoMsgOption(store.getDefaultBoolean(TraceConstants.PROFILE_TIPS));
93
	_options.setInfoMsgOption(store.getDefaultBoolean(TraceConstants.PROFILE_TIPS));
95
	_options.setReloadMsgOption(store.getDefaultBoolean(CommonUITraceConstants.RELOAD_INFO));
94
	_options.setReloadMsgOption(store.getDefaultBoolean(CommonUITraceConstants.RELOAD_INFO));
Lines 99-106 Link Here
99
	_options.setSwitchPerspOption(CommonUIPlugin.getDefault().getPreferenceStore().getDefaultString(HyadesUI.SWITCH_TO_PERSPECTIVE_KEY));
98
	_options.setSwitchPerspOption(CommonUIPlugin.getDefault().getPreferenceStore().getDefaultString(HyadesUI.SWITCH_TO_PERSPECTIVE_KEY));
100
	_options.setRefreshType(store.getDefaultInt(TraceConstants.REFRESH_TYPE), store.getDefaultInt(TraceConstants.REFRESH_INTERVAL));
99
	_options.setRefreshType(store.getDefaultInt(TraceConstants.REFRESH_TYPE), store.getDefaultInt(TraceConstants.REFRESH_INTERVAL));
101
100
102
	store = UIPlugin.getDefault().getPreferenceStore();
103
	_options.setLocalHostPort(store.getDefaultString(CommonUIConstants.LOCALHOST_PORT));
104
}
101
}
105
/**
102
/**
106
 * Does anything necessary because the default button has been pressed.
103
 * Does anything necessary because the default button has been pressed.
Lines 127-133 Link Here
127
	IPreferenceStore store = getPreferenceStore();
124
	IPreferenceStore store = getPreferenceStore();
128
	
125
	
129
	store.setValue(CommonUITraceConstants.TRACE_PROJECT_NAME, _options.getProjectName());	
126
	store.setValue(CommonUITraceConstants.TRACE_PROJECT_NAME, _options.getProjectName());	
130
	store.setValue(CommonUIConstants.LOCALHOST_PORT, _options.getLocalPortNumber());	
131
	store.setValue(TraceConstants.PROFILE_TIPS, _options.getInfoMsgOption());	
127
	store.setValue(TraceConstants.PROFILE_TIPS, _options.getInfoMsgOption());	
132
	store.setValue(CommonUITraceConstants.RELOAD_INFO, _options.getReloadMsgOption());
128
	store.setValue(CommonUITraceConstants.RELOAD_INFO, _options.getReloadMsgOption());
133
	/* Navid Mehregani - bugzilla_158635: The SAVE_ON_EXIT_KEY option should be read and stored in the preference store of CommonUITracePlugin */
129
	/* Navid Mehregani - bugzilla_158635: The SAVE_ON_EXIT_KEY option should be read and stored in the preference store of CommonUITracePlugin */
(-)src/org/eclipse/hyades/trace/ui/internal/util/AttachConfigurationDetail.java (-1 / +2 lines)
Lines 18-23 Link Here
18
import org.eclipse.debug.core.ILaunchConfiguration;
18
import org.eclipse.debug.core.ILaunchConfiguration;
19
import org.eclipse.hyades.trace.ui.UIPlugin;
19
import org.eclipse.hyades.trace.ui.UIPlugin;
20
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
20
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
21
import org.eclipse.hyades.ui.HyadesUIPlugin;
21
import org.eclipse.jface.preference.IPreferenceStore;
22
import org.eclipse.jface.preference.IPreferenceStore;
22
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
23
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
23
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
24
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
Lines 83-89 Link Here
83
	{
84
	{
84
		try
85
		try
85
		{
86
		{
86
			IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();
87
			IPreferenceStore store = HyadesUIPlugin.getInstance().getPreferenceStore();
87
			this.hostName = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
88
			this.hostName = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
88
			this.portNumber = String.valueOf(configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, store.getInt(CommonUIConstants.LOCALHOST_PORT)));
89
			this.portNumber = String.valueOf(configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, store.getInt(CommonUIConstants.LOCALHOST_PORT)));
89
			this.project = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_DESTINATION_PROJECT, store.getString(CommonUITraceConstants.TRACE_PROJECT_NAME));
90
			this.project = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_DESTINATION_PROJECT, store.getString(CommonUITraceConstants.TRACE_PROJECT_NAME));
(-)src/org/eclipse/tptp/trace/ui/internal/launcher/deleg/application/PIDelegateHelper.java (-1 / +2 lines)
Lines 39-44 Link Here
39
import org.eclipse.hyades.trace.ui.internal.piclient.PIProcessListener;
39
import org.eclipse.hyades.trace.ui.internal.piclient.PIProcessListener;
40
import org.eclipse.hyades.trace.ui.internal.util.PDCoreUtil;
40
import org.eclipse.hyades.trace.ui.internal.util.PDCoreUtil;
41
import org.eclipse.hyades.trace.ui.launcher.IProfilingType;
41
import org.eclipse.hyades.trace.ui.launcher.IProfilingType;
42
import org.eclipse.hyades.ui.HyadesUIPlugin;
42
import org.eclipse.tptp.platform.common.internal.CommonPlugin;
43
import org.eclipse.tptp.platform.common.internal.CommonPlugin;
43
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
44
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
44
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
45
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
Lines 419-425 Link Here
419
					try
420
					try
420
					{	
421
					{	
421
						JVMVersionDetector.this.host = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
422
						JVMVersionDetector.this.host = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_HOSTNAME, CommonUITraceConstants.LOCAL_HOST);
422
						JVMVersionDetector.this.port = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, UIPlugin.getDefault().getPreferenceStore().getDefaultInt(CommonUIConstants.LOCALHOST_PORT));		
423
						JVMVersionDetector.this.port = configuration.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, HyadesUIPlugin.getInstance().getPreferenceStore().getDefaultInt(CommonUIConstants.LOCALHOST_PORT));		
423
					} 
424
					} 
424
					catch (CoreException e)
425
					catch (CoreException e)
425
					{
426
					{
(-)src/org/eclipse/tptp/trace/ui/internal/launcher/core/LauncherUtility.java (-1 / +2 lines)
Lines 60-65 Link Here
60
import org.eclipse.hyades.trace.ui.launcher.IProfilingSet;
60
import org.eclipse.hyades.trace.ui.launcher.IProfilingSet;
61
import org.eclipse.hyades.trace.ui.launcher.IProfilingSetType;
61
import org.eclipse.hyades.trace.ui.launcher.IProfilingSetType;
62
import org.eclipse.hyades.trace.ui.launcher.ProfilingAttribute;
62
import org.eclipse.hyades.trace.ui.launcher.ProfilingAttribute;
63
import org.eclipse.hyades.ui.HyadesUIPlugin;
63
import org.eclipse.jdt.launching.IVMRunner;
64
import org.eclipse.jdt.launching.IVMRunner;
64
import org.eclipse.jdt.launching.VMRunnerConfiguration;
65
import org.eclipse.jdt.launching.VMRunnerConfiguration;
65
import org.eclipse.jface.dialogs.ErrorDialog;
66
import org.eclipse.jface.dialogs.ErrorDialog;
Lines 825-831 Link Here
825
	 */
826
	 */
826
	public static int getPort (ILaunchConfiguration conf) throws CoreException
827
	public static int getPort (ILaunchConfiguration conf) throws CoreException
827
	{
828
	{
828
		IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();
829
		IPreferenceStore store = HyadesUIPlugin.getInstance().getPreferenceStore();
829
		int port = conf.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, store.getInt(CommonUIConstants.LOCALHOST_PORT));
830
		int port = conf.getAttribute(IProfileLaunchConfigurationConstants.ATTR_PORT, store.getInt(CommonUIConstants.LOCALHOST_PORT));
830
		return port;		
831
		return port;		
831
	}
832
	}

Return to bug 199594