|
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 |
} |