Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-20 02:49:29 +0000
committerJean Michel-Lemieux2003-10-20 02:49:29 +0000
commit1735a6677e35c5e398eb47c38e464a46e704bc78 (patch)
tree5c4d4c9d71a829b9148dc4648f64d7300e78f20f
parent3dea3eac016f9f7a6e7ab10d8632293f7808f87b (diff)
downloadeclipse.platform.team-1735a6677e35c5e398eb47c38e464a46e704bc78.tar.gz
eclipse.platform.team-1735a6677e35c5e398eb47c38e464a46e704bc78.tar.xz
eclipse.platform.team-1735a6677e35c5e398eb47c38e464a46e704bc78.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/TextToolbarManager.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ToolItemActionContributionItem.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java27
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetDropDownAction.java10
6 files changed, 60 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java
index 95fe40e1f..28af7337e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java
@@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.*;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.team.core.subscribers.TeamSubscriber;
@@ -73,11 +74,14 @@ public class CVSSynchronizeParticipant extends TeamSubscriberParticipant impleme
* @see org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener#syncSetChanged(org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent)
*/
public void syncSetChanged(SyncSetChangedEvent event) {
- IStructuredContentProvider cp = (IStructuredContentProvider)getPage().getViewer().getContentProvider();
- StructuredSelection selection = new StructuredSelection(cp.getElements(getInput()));
- for (Iterator it = delegates.iterator(); it.hasNext(); ) {
- CVSActionDelegate delegate = (CVSActionDelegate) it.next();
- delegate.getDelegate().selectionChanged(delegate, selection);
+ StructuredViewer viewer = getPage().getViewer();
+ if(viewer != null) {
+ IStructuredContentProvider cp = (IStructuredContentProvider)viewer.getContentProvider();
+ StructuredSelection selection = new StructuredSelection(cp.getElements(getInput()));
+ for (Iterator it = delegates.iterator(); it.hasNext(); ) {
+ CVSActionDelegate delegate = (CVSActionDelegate) it.next();
+ delegate.getDelegate().selectionChanged(delegate, selection);
+ }
}
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 0145ca6a1..21943598f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -333,8 +333,8 @@ action.toggleViewFlat.image=flatLayout.gif
action.toggleViewHierarchical.label=Hierarchical
action.toggleViewHierarchical.image=hierarchicalLayout.gif
-action.workingSets.label=<None>
-action.workingSets.none=<None>
+action.workingSets.label=Working Sets
+action.workingSets.none=Working Sets
action.workingSets.tooltip=Working Sets
action.workingSets.description=Working Sets
action.workingSets.image=workingsets.gif
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/TextToolbarManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/TextToolbarManager.java
index 539b4ac25..075694d73 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/TextToolbarManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/TextToolbarManager.java
@@ -25,4 +25,11 @@ public class TextToolbarManager extends ToolBarManager {
public void add(IAction action) {
super.add(new ToolItemActionContributionItem(action));
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IContributionManager#add(org.eclipse.jface.action.IAction)
+ */
+ public void add(IAction action, int preferedSize) {
+ super.add(new ToolItemActionContributionItem(action, preferedSize));
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ToolItemActionContributionItem.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ToolItemActionContributionItem.java
index 9383cdf90..8f4b88eb9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ToolItemActionContributionItem.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ToolItemActionContributionItem.java
@@ -43,6 +43,8 @@ public class ToolItemActionContributionItem extends ContributionItem {
*/
private Widget parentWidget = null;
+ private int preferedSize = -1;
+
/**
* Listener for action property change notifications.
*/
@@ -182,6 +184,16 @@ public ToolItemActionContributionItem(IAction action) {
super(action.getId());
this.action = action;
}
+
+/**
+ * @param action2
+ * @param preferedSize
+ */
+public ToolItemActionContributionItem(IAction action, int preferedSize) {
+ this(action);
+ this.preferedSize = preferedSize;
+}
+
/**
* Handles a property change event on the action (forwarded by nested listener).
*/
@@ -336,6 +348,10 @@ public void fill(ToolBar parent, int index) {
ti.addListener(SWT.Selection, getToolItemListener());
ti.addListener(SWT.Dispose, getToolItemListener());
+ if(preferedSize != -1) {
+ ti.setWidth(preferedSize);
+ }
+
widget = ti;
parentWidget = parent;
@@ -593,7 +609,6 @@ public void update(String propertyName) {
if (widget instanceof ToolItem) {
ToolItem ti = (ToolItem) widget;
-
if(textChanged)
ti.setText(action.getText());
@@ -609,7 +624,7 @@ public void update(String propertyName) {
if (ti.getEnabled() != shouldBeEnabled)
ti.setEnabled(shouldBeEnabled);
}
-
+ if(preferedSize > 0) ti.setWidth(preferedSize);
if (checkChanged) {
boolean bv = action.isChecked();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
index dbaef7010..2aed2eafd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
@@ -19,6 +19,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.sync.pages.TextToolbarManager;
import org.eclipse.team.internal.ui.sync.sets.*;
import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
import org.eclipse.ui.IActionBars;
@@ -125,9 +126,17 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
* @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
*/
public void fillToolBar(IToolBarManager toolBar) {
+ boolean custom = false;
+ if(toolBar instanceof TextToolbarManager) {
+ custom = true;
+ }
for (Iterator it = actions.iterator(); it.hasNext();) {
DirectionFilterAction action = (DirectionFilterAction) it.next();
- toolBar.add(action);
+ if(custom) {
+ ((TextToolbarManager)toolBar).add(action, 150);
+ } else {
+ toolBar.add(action);
+ }
}
}
@@ -183,18 +192,22 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
bothMode.setText(new Integer(input.getWorkingSetSyncSet().size()).toString());
if(input.getWorkingSet() != null) {
if(conflictsMode != null)
- conflictsMode.setText(Policy.bind("StatisticsPanel.changeNumbers", new Integer(workingSetConflicting).toString(), new Integer(workspaceConflicting).toString())); //$NON-NLS-1$
+ conflictsMode.setText(padString(Policy.bind("StatisticsPanel.changeNumbers", new Integer(workingSetConflicting).toString(), new Integer(workspaceConflicting).toString()))); //$NON-NLS-1$
if(incomingMode != null)
- incomingMode.setText(Policy.bind("StatisticsPanel.changeNumbers", new Integer(workingSetIncoming).toString(), new Integer(workspaceIncoming).toString())); //$NON-NLS-1$
+ incomingMode.setText(padString(Policy.bind("StatisticsPanel.changeNumbers", new Integer(workingSetIncoming).toString(), new Integer(workspaceIncoming).toString()))); //$NON-NLS-1$
if(outgoingMode != null)
- outgoingMode.setText(Policy.bind("StatisticsPanel.changeNumbers", new Integer(workingSetOutgoing).toString(), new Integer(workspaceOutgoing).toString())); //$NON-NLS-1$
+ outgoingMode.setText(padString(Policy.bind("StatisticsPanel.changeNumbers", new Integer(workingSetOutgoing).toString(), new Integer(workspaceOutgoing).toString()))); //$NON-NLS-1$
} else {
if(conflictsMode != null)
- conflictsMode.setText(new Integer(workspaceConflicting).toString()); //$NON-NLS-1$
+ conflictsMode.setText(padString(new Integer(workspaceConflicting).toString())); //$NON-NLS-1$
if(incomingMode != null)
- incomingMode.setText(new Integer(workspaceIncoming).toString()); //$NON-NLS-1$
+ incomingMode.setText(padString(new Integer(workspaceIncoming).toString())); //$NON-NLS-1$
if(outgoingMode != null)
- outgoingMode.setText(new Integer(workspaceOutgoing).toString()); //$NON-NLS-1$
+ outgoingMode.setText(padString(new Integer(workspaceOutgoing).toString())); //$NON-NLS-1$
}
}
+
+ private String padString(String s) {
+ return s;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetDropDownAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetDropDownAction.java
index 71c0a9c77..bef4d1843 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetDropDownAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetDropDownAction.java
@@ -116,10 +116,10 @@ public class WorkingSetDropDownAction extends Action implements IMenuCreator, IP
}
private void updateWorkingSet(IWorkingSet set) {
- if (set != null) {
- setText(set.getName());
- } else if (set == null) {
- setText(Policy.bind("action.workingSets.none"));
- }
+// if (set != null) {
+// setText(set.getName());
+// } else if (set == null) {
+// setText(Policy.bind("action.workingSets.none"));
+// }
}
}

Back to the top