Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-30 20:08:30 +0000
committerMichael Valenta2004-09-30 20:08:30 +0000
commit87dc5696c4ba7504b385574d00b50eaf89b0fb5f (patch)
treec7f14fc0307883fb4676c2f61768d134f5e0c116
parent2c1cf9c2d78be3223260ef440f70418b670eb0ce (diff)
downloadeclipse.platform.team-87dc5696c4ba7504b385574d00b50eaf89b0fb5f.tar.gz
eclipse.platform.team-87dc5696c4ba7504b385574d00b50eaf89b0fb5f.tar.xz
eclipse.platform.team-87dc5696c4ba7504b385574d00b50eaf89b0fb5f.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java33
1 files changed, 30 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
index 2a1bc969a..00764e8f9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
@@ -46,14 +46,19 @@ public class ChangeSetModelManager extends HierarchicalModelManager implements I
}
}
+ private ToggleCommitSetAction toggleCommitSetAction;
+
private class CommitSetActionContribution extends SynchronizePageActionGroup {
- public void initialize(ISynchronizePageConfiguration configuration) {
+
+ public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
- appendToGroup(
+ toggleCommitSetAction = new ToggleCommitSetAction();
+ appendToGroup(
ISynchronizePageConfiguration.P_TOOLBAR_MENU,
CHANGE_SET_GROUP,
- new ToggleCommitSetAction());
+ toggleCommitSetAction);
+ updateEnablement();
}
}
@@ -65,7 +70,29 @@ public class ChangeSetModelManager extends HierarchicalModelManager implements I
if (configuration.getParticipant().getChangeSetCapability().supportsActiveChangeSets()) {
configuration.addLabelDecorator(new ChangeSetLabelDecorator(configuration));
}
+ configuration.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(ISynchronizePageConfiguration.P_MODE)) {
+ updateEnablement();
+ }
+ }
+
+ });
}
+
+ private void updateEnablement() {
+ if (toggleCommitSetAction != null) {
+ boolean enabled = false;
+ int mode = getConfiguration().getMode();
+ if (mode == ISynchronizePageConfiguration.INCOMING_MODE) {
+ enabled = getConfiguration().getParticipant().getChangeSetCapability().supportsCheckedInChangeSets();
+ } else if (mode == ISynchronizePageConfiguration.OUTGOING_MODE) {
+ enabled = getConfiguration().getParticipant().getChangeSetCapability().supportsActiveChangeSets();
+ }
+ toggleCommitSetAction.setEnabled(enabled);
+ }
+
+ }
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.synchronize.SynchronizeModelManager#dispose()

Back to the top