summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorCamilo Bernal2012-10-05 17:18:54 (EDT)
committer Roland Grunberg2012-10-09 15:49:44 (EDT)
commit03ec5ab9426ce7f6e32ee055c35d27dd61d192f1 (patch)
tree56493d97648627a5e2b0b6bc79db7b766c3a16d3
parent9afba9f873e1df63b5a3cc1f1bb67497c6914d92 (diff)
downloadorg.eclipse.linuxtools-03ec5ab9426ce7f6e32ee055c35d27dd61d192f1.zip
org.eclipse.linuxtools-03ec5ab9426ce7f6e32ee055c35d27dd61d192f1.tar.gz
org.eclipse.linuxtools-03ec5ab9426ce7f6e32ee055c35d27dd61d192f1.tar.bz2
Provider plug-in: Validate tool specific tab configurations.
Extend functionality of ProviderOptionsTab#isValid() to apply tool specific validation on the respective tab configurations. Change-Id: I8d6a2e3862694ec312f1a4c0e63d5525ee30abb6 Reviewed-on: https://git.eclipse.org/r/8068 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java
index 6fff9b4..a0bf5d0 100644
--- a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java
+++ b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/ProviderOptionsTab.java
@@ -78,6 +78,10 @@ public class ProviderOptionsTab extends ProfileLaunchConfigurationTab {
String curProviderId = comboItems.get(providerCombo.getText());
loadTabGroupItems(tabgroup, curProviderId);
initializeFrom(initial);
+ // Since we are calling initializeFrom manually, we have to
+ // update the launch configuration dialog manually to ensure
+ // initial validation on the configuration.
+ updateLaunchConfigurationDialog();
top.layout();
}
});
@@ -278,6 +282,22 @@ public class ProviderOptionsTab extends ProfileLaunchConfigurationTab {
setErrorMessage(Messages.ProviderOptionsTab_0);
return false;
}
+
+ Boolean isInitialized = initialized.get(getProviderId());
+
+ if (isInitialized) {
+ // Tabs should not be null after initialization.
+ if (tabs == null) {
+ return false;
+ }
+
+ // Validate tab configurations of underlying tool.
+ for (AbstractLaunchConfigurationTab tab : tabs) {
+ if (!tab.isValid(config)) {
+ return false;
+ }
+ }
+ }
return true;
}