Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 228317 Details for
Bug 402787
Move ETFW Version menu to preference page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patches etfw launch tab
org.eclipse.ptp.etfw.launch.patch (text/plain), 11.95 KB, created by
Chris Navarro
on 2013-03-12 16:48:33 EDT
(
hide
)
Description:
patches etfw launch tab
Filename:
MIME Type:
Creator:
Chris Navarro
Created:
2013-03-12 16:48:33 EDT
Size:
11.95 KB
patch
obsolete
>diff --git a/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/PerformanceAnalysisTab.java b/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/PerformanceAnalysisTab.java >index fc30042..a1651d1 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/PerformanceAnalysisTab.java >+++ b/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/PerformanceAnalysisTab.java >@@ -22,7 +22,9 @@ > import org.eclipse.debug.ui.ILaunchConfigurationDialog; > import org.eclipse.debug.ui.ILaunchConfigurationTab; > import org.eclipse.ptp.core.util.LaunchUtils; >+import org.eclipse.ptp.etfw.Activator; > import org.eclipse.ptp.etfw.IToolLaunchConfigurationConstants; >+import org.eclipse.ptp.etfw.PreferenceConstants; > import org.eclipse.ptp.etfw.jaxb.JAXBInitializationUtil; > import org.eclipse.ptp.etfw.jaxb.data.BuildToolType; > import org.eclipse.ptp.etfw.jaxb.data.EtfwToolProcessType; >@@ -38,6 +40,7 @@ > import org.eclipse.ptp.launch.ui.extensions.IRMLaunchConfigurationContentsChangedListener; > import org.eclipse.ptp.launch.ui.extensions.IRMLaunchConfigurationDynamicTab; > import org.eclipse.ptp.launch.ui.extensions.JAXBDynamicLaunchConfigurationTab; >+import org.eclipse.ptp.remote.core.Preferences; > import org.eclipse.ptp.rm.jaxb.control.core.ILaunchController; > import org.eclipse.ptp.rm.jaxb.control.core.LaunchControllerManager; > import org.eclipse.ptp.rm.jaxb.control.ui.IUpdateModel; >@@ -86,14 +89,11 @@ > private Composite topComposite; > private Composite toolComposite; > private Composite bottomComposite; >- private Combo etfwCombo; > private Combo toolCombo; > private Label selectToolLbl; > private Button buildOnlyCheck; > private Button analyzeonlyCheck; > private String controlId; >- private Button addWorkflowButton; >- private Button removeWorkflowButton; > // I believe this should be part of the launchTabParent, but there is RM specifics that must be removed > private final LinkedList<IJAXBLaunchConfigurationTab> tabControllers = new LinkedList<IJAXBLaunchConfigurationTab>(); > private final ContentsChangedListener launchContentsChangedListener = new ContentsChangedListener(); >@@ -127,28 +127,6 @@ > topComposite.setLayout(new GridLayout(2, false)); > topComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); > >- Label whichETFWLbl = new Label(topComposite, SWT.NONE); >- whichETFWLbl.setText(IETFWLaunchConfigurationConstants.ETFW_VERSION); >- >- etfwCombo = new Combo(topComposite, SWT.READ_ONLY); >- etfwCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); >- etfwCombo.setItems(new String[] { IETFWLaunchConfigurationConstants.SAX_PARSER, >- IETFWLaunchConfigurationConstants.JAXB_PARSER }); >- etfwCombo.select(1); >- etfwCombo.addSelectionListener(new SelectionAdapter() { >- >- @Override >- public void widgetSelected(SelectionEvent e) { >- if (etfwCombo.getSelectionIndex() == 0) { >- buildSAXParserETFW(); >- } else { >- buildJAXBParserETFW(); >- } >- } >- }); >- >- buildNewETFW(); >- > toolComposite = new Composite(content, SWT.NONE); > toolComposite.setLayout(new FillLayout()); > toolComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >@@ -162,63 +140,20 @@ > > analyzeonlyCheck = new Button(bottomComposite, SWT.CHECK); > analyzeonlyCheck.setText(Messages.PerformanceAnalysisTab_SelectExistingPerfData); >+ >+ String parser = Preferences.getString(Activator.PLUGIN_ID, PreferenceConstants.ETFW_VERSION); >+ if (parser.equals(IToolLaunchConfigurationConstants.USE_SAX_PARSER)) { >+ buildSAXParserUI(); >+ } else { >+ buildJAXBParserUI(); >+ } > } > >- private void buildNewETFW() { >- clearOldWidgets(); >- >- selectToolLbl = new Label(topComposite, SWT.NONE); >- selectToolLbl.setText("Select tool: "); //$NON-NLS-1$ >- >- toolCombo = new Combo(topComposite, SWT.READ_ONLY); >- toolCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); >- String[] toolNames = JAXBExtensionUtils.getToolNames(); >- for (String name : toolNames) { >- toolCombo.add(name); >- } >- >- toolCombo.addSelectionListener(listener); >- >- addWorkflowButton = new Button(topComposite, SWT.PUSH); >- addWorkflowButton.setText("Add Workflow"); //$NON-NLS-1$ >- >- removeWorkflowButton = new Button(topComposite, SWT.PUSH); >- removeWorkflowButton.setText("Remove Workflow"); //$NON-NLS-1$ >- } >- >- private void buildJAXBParserETFW() { >- buildNewETFW(); >- bottomComposite.setVisible(true); >- String toolName; >- try { >- toolName = this.launchConfiguration.getAttribute("selected_performance_tool", ""); //$NON-NLS-1$ //$NON-NLS-2$ >- if (!toolName.isEmpty()) { >- for (int index = 0; index < toolCombo.getItemCount(); index++) { >- if (toolCombo.getItem(index).equals(toolName)) { >- toolCombo.select(index); >- toolCombo.notifyListeners(SWT.Selection, null); >- break; >- } >- >- } >- } >- } catch (CoreException e) { >- e.printStackTrace(); >- } >- >- } >- >- private void buildSAXParserETFW() { >- for (Control child : toolComposite.getChildren()) { >- child.dispose(); >- } >- >- clearOldWidgets(); >+ private void buildSAXParserUI() { > bottomComposite.setVisible(false); > > saxETFWTab = new ExternalToolSelectionTab(true); > saxETFWTab.createControl(toolComposite); >- saxETFWTab.initializeFrom(this.launchConfiguration); > saxETFWTab.setLaunchConfigurationDialog(this.getLaunchConfigurationDialog()); > > toolComposite.getParent().layout(); >@@ -226,7 +161,31 @@ > toolComposite.layout(); > } > >+ private void buildJAXBParserUI() { >+ selectToolLbl = new Label(topComposite, SWT.NONE); >+ selectToolLbl.setText(Messages.PerformanceAnalysisTab_SelectTool); >+ >+ toolCombo = new Combo(topComposite, SWT.READ_ONLY); >+ toolCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); >+ String[] toolNames = JAXBExtensionUtils.getToolNames(); >+ toolCombo.add(Messages.PerformanceAnalysisTab_PleaseSelectWorkflow); >+ for (String name : toolNames) { >+ toolCombo.add(name); >+ } >+ >+ toolCombo.addSelectionListener(listener); >+ toolCombo.select(0); >+ >+ toolComposite.getParent().layout(); >+ topComposite.layout(); >+ toolComposite.layout(); >+ } >+ > private void rebuildTab(String toolName) { >+ if (toolName.equals(Messages.PerformanceAnalysisTab_PleaseSelectWorkflow)) { >+ clearOldWidgets(); >+ return; >+ } > etfwTool = JAXBExtensionUtils.getTool(toolName); > vmap = new ETFWVariableMap(); > >@@ -391,22 +350,20 @@ > controller = LaunchControllerManager.getInstance().getLaunchController(remId, remName, rmType); > if (controller != null) { > controlId = controller.getControlId(); >- >- String toolName = configuration.getAttribute(IToolLaunchConfigurationConstants.SELECTED_TOOL, >- IToolLaunchConfigurationConstants.EMPTY_STRING); >- if (!toolName.isEmpty()) { >- if (etfwCombo.getSelectionIndex() == 1) { >- >- for (int index = 0; index < toolCombo.getItemCount(); index++) { >- if (toolCombo.getItem(index).equals(toolName)) { >- toolCombo.select(index); >- toolCombo.notifyListeners(SWT.Selection, null); >- break; >- } >- >+ String parser = Preferences.getString(Activator.PLUGIN_ID, PreferenceConstants.ETFW_VERSION); >+ if (parser.equals(IToolLaunchConfigurationConstants.USE_SAX_PARSER)) { >+ // buildSAXParserUI(); >+ saxETFWTab.initializeFrom(configuration); >+ } else { >+ String toolName = configuration.getAttribute(IToolLaunchConfigurationConstants.SELECTED_TOOL, >+ IToolLaunchConfigurationConstants.EMPTY_STRING); >+ for (int index = 0; index < toolCombo.getItemCount(); index++) { >+ if (toolCombo.getItem(index).equals(toolName)) { >+ toolCombo.select(index); >+ toolCombo.notifyListeners(SWT.Selection, null); >+ break; > } > } >- > } > } > } catch (CoreException e) { >@@ -417,14 +374,12 @@ > @Override > public void performApply(ILaunchConfigurationWorkingCopy configuration) { > >- if (etfwCombo.getSelectionIndex() == 0) { >- configuration >- .setAttribute(IToolLaunchConfigurationConstants.ETFW_VERSION, IToolLaunchConfigurationConstants.USE_SAX_PARSER); >+ String parser = Preferences.getString(Activator.PLUGIN_ID, PreferenceConstants.ETFW_VERSION); >+ configuration.setAttribute(IToolLaunchConfigurationConstants.ETFW_VERSION, parser); >+ if (parser.equals(IToolLaunchConfigurationConstants.USE_SAX_PARSER)) { > saxETFWTab.performApply(configuration); > } else { >- configuration.setAttribute(IToolLaunchConfigurationConstants.ETFW_VERSION, >- IToolLaunchConfigurationConstants.USE_JAXB_PARSER); >- if (toolCombo.getSelectionIndex() != -1) { >+ if (toolCombo.getSelectionIndex() > 0) { > String selectedtool = toolCombo.getItem(toolCombo.getSelectionIndex()); > configuration.setAttribute(SELECTED_TOOL, selectedtool); > >@@ -484,12 +439,10 @@ > } > > private void clearOldWidgets() { >- if (selectToolLbl != null) { >- selectToolLbl.dispose(); >- toolCombo.dispose(); >- addWorkflowButton.dispose(); >- removeWorkflowButton.dispose(); >+ for (Control child : toolComposite.getChildren()) { >+ child.dispose(); > } >+ > } > > /** >@@ -497,7 +450,7 @@ > */ > @Override > public String getName() { >- return "Performance Analysis"; //$NON-NLS-1$ >+ return Messages.PerformanceAnalysisTab_Tab_Name; > } > > @Override >@@ -516,7 +469,14 @@ > @Override > public boolean isValid(ILaunchConfiguration configuration) { > setErrorMessage(null); >- if (launchTabParent != null) { >+ >+ if (toolCombo != null) { >+ if (toolCombo.getSelectionIndex() == 0) { >+ setErrorMessage(Messages.PerformanceAnalysisTab_NoWorkflowSelected); >+ return false; >+ } >+ } >+ else if (launchTabParent != null) { > String error = launchTabParent.getUpdateHandler().getFirstError(); > if (error != null) { > setErrorMessage(error); >diff --git a/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/Messages.java b/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/Messages.java >index 0f7b5b5..2a12a2f 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/Messages.java >+++ b/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/Messages.java >@@ -7,7 +7,13 @@ > public static String ETFWToolTabBuilder_ToggleShowHideSelectedAttributes; > public static String ETFWVariableResolver_DE_REF_ERROR; > public static String PerformanceAnalysisTab_BuildInstrumentedExecutable; >+ public static String PerformanceAnalysisTab_NoWorkflowSelected; >+ public static String PerformanceAnalysisTab_NoWorkflowTypeSelected; >+ public static String PerformanceAnalysisTab_PleaseSelectWorkflow; >+ public static String PerformanceAnalysisTab_PleaseSelectWorkflowType; > public static String PerformanceAnalysisTab_SelectExistingPerfData; >+ public static String PerformanceAnalysisTab_SelectTool; >+ public static String PerformanceAnalysisTab_Tab_Name; > static { > // initialize resource bundle > NLS.initializeMessages(BUNDLE_NAME, Messages.class); >diff --git a/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/messages.properties b/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/messages.properties >index 475ddf6..c7105d6 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/messages.properties >+++ b/tools/etfw/org.eclipse.ptp.etfw.launch/src/org/eclipse/ptp/etfw/launch/messages/messages.properties >@@ -1,4 +1,10 @@ > ETFWToolTabBuilder_ToggleShowHideSelectedAttributes=Show Only Checked Items > ETFWVariableResolver_DE_REF_ERROR=ETFW Tool variable dereferencing error > PerformanceAnalysisTab_BuildInstrumentedExecutable=Build the instrumented executable but do not launch it >+PerformanceAnalysisTab_NoWorkflowSelected=No workflow selected. >+PerformanceAnalysisTab_NoWorkflowTypeSelected=No workflow type selected. >+PerformanceAnalysisTab_PleaseSelectWorkflow=Please select a workflow >+PerformanceAnalysisTab_PleaseSelectWorkflowType=Please select a workflow type > PerformanceAnalysisTab_SelectExistingPerfData=Select existing performance data to analyze with the selected tool >+PerformanceAnalysisTab_SelectTool=Select tool: >+PerformanceAnalysisTab_Tab_Name=Performance Analysis
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 402787
:
228315
| 228317