Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-11-25 03:34:36 -0500
committerTobias Schwarz2013-11-25 03:34:36 -0500
commitd0663de337b90ce8a936db87bff4724ff3acf0df (patch)
tree55718f4568d8b3c0b616a9443334f5669c66708c /target_explorer
parent03fefdeb705cc20d4fd354538fab8b1e1fcb4b1a (diff)
downloadorg.eclipse.tcf-d0663de337b90ce8a936db87bff4724ff3acf0df.tar.gz
org.eclipse.tcf-d0663de337b90ce8a936db87bff4724ff3acf0df.tar.xz
org.eclipse.tcf-d0663de337b90ce8a936db87bff4724ff3acf0df.zip
Target Explorer: add description (tooltip) to simulator config button
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java103
2 files changed, 64 insertions, 48 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java
index 40867de03..a4d7baa12 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java
@@ -202,7 +202,16 @@ public class SimulatorTypeSelectionControl extends BaseEditBrowseTextControl {
ISimulatorServiceUIDelegate uiDelegate = id2delegate.get(id);
if (getButtonControl() != null) {
getButtonControl().setEnabled(enabled && uiDelegate != null && uiDelegate.canConfigure());
+ if (getButtonControl().isEnabled() && uiDelegate != null) {
+ String config = id2config.get(getSelectedSimulatorId());
+ String description = uiDelegate.getDescription(config);
+ getButtonControl().setToolTipText(description);
+ }
+ else {
+ getButtonControl().setToolTipText(null);
+ }
}
+
}
/* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java
index 6cf105c88..62e6b1a86 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java
@@ -1,48 +1,55 @@
-/*******************************************************************************
- * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.ui.interfaces.services;
-
-import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
-
-/**
- * Simulator service UI delegate.
- */
-public interface ISimulatorServiceUIDelegate {
-
- /**
- * Get the simulator service the UI delegate is associated with.
- *
- * @return The simulator service.
- */
- public ISimulatorService getService();
-
- /**
- * Get the name of the simulator service to identify the simulator (type)
- * to the user in the UI.
- *
- * @return The simulator service name.
- */
- public String getName();
-
- /**
- * Configure the simulator.
- *
- * @param context The context for which the simulator should be configured.
- * @param oldConfig The previous configuration or <code>null</code>.
- * @return The new configuration or <code>null</code>.
- */
- public String configure(Object context, String oldConfig);
-
- /**
- * Returns <code>true</code> if the simulator is configurable.
- * @return <code>true</code> if the simulator is configurable.
- */
- public boolean canConfigure();
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.interfaces.services;
+
+import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
+
+/**
+ * Simulator service UI delegate.
+ */
+public interface ISimulatorServiceUIDelegate {
+
+ /**
+ * Get the simulator service the UI delegate is associated with.
+ *
+ * @return The simulator service.
+ */
+ public ISimulatorService getService();
+
+ /**
+ * Get the name of the simulator service to identify the simulator (type)
+ * to the user in the UI.
+ *
+ * @return The simulator service name.
+ */
+ public String getName();
+
+ /**
+ * Get a description fo rthe given config.
+ * This description is shown i.e. as tooltip of the configure button.
+ * @return The description of the given config.
+ */
+ public String getDescription(String config);
+
+ /**
+ * Configure the simulator.
+ *
+ * @param context The context for which the simulator should be configured.
+ * @param oldConfig The previous configuration or <code>null</code>.
+ * @return The new configuration or <code>null</code>.
+ */
+ public String configure(Object context, String oldConfig);
+
+ /**
+ * Returns <code>true</code> if the simulator is configurable.
+ * @return <code>true</code> if the simulator is configurable.
+ */
+ public boolean canConfigure();
+}

Back to the top