diff options
author | Michael Valenta | 2006-02-22 11:05:08 +0000 |
---|---|---|
committer | Michael Valenta | 2006-02-22 11:05:08 +0000 |
commit | e2a803f3c09d8015efa49a0a757358db22169433 (patch) | |
tree | 260303852c0dccb0dbc84618d3c2e1ae7e9be418 /bundles/org.eclipse.team.ui/src/org/eclipse | |
parent | 01e40934bc1eea8a95bac692569e145ce5b219fc (diff) | |
download | eclipse.platform.team-e2a803f3c09d8015efa49a0a757358db22169433.tar.gz eclipse.platform.team-e2a803f3c09d8015efa49a0a757358db22169433.tar.xz eclipse.platform.team-e2a803f3c09d8015efa49a0a757358db22169433.zip |
Use the proper label for the model provider
Diffstat (limited to 'bundles/org.eclipse.team.ui/src/org/eclipse')
3 files changed, 14 insertions, 9 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java index 8168f6f5a..6f088e857 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java @@ -880,6 +880,16 @@ public class Utils { return adapter.getName(mapping); return pathString; } + + public static String getLabel(ModelProvider provider) { + ResourceMapping mapping = Utils.getResourceMapping(provider); + if (mapping != null) { + String base = Utils.getLabel(mapping); + if (base != null && base.length() > 0) + return base; + } + return provider.getDescriptor().getLabel(); + } public static String getScopeDescription(ISynchronizationScope scope) { ResourceMapping[] mappings = scope.getInputMappings(); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ShowModelProviderAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ShowModelProviderAction.java index 277ef98db..96798da67 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ShowModelProviderAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/mapping/ShowModelProviderAction.java @@ -16,6 +16,7 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.Viewer; import org.eclipse.osgi.util.NLS; import org.eclipse.team.internal.ui.TeamUIMessages; +import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant; @@ -25,7 +26,7 @@ public class ShowModelProviderAction extends Action { private final ModelProvider provider; public ShowModelProviderAction(ISynchronizePageConfiguration configuration, ModelProvider provider) { - super(provider.getDescriptor().getLabel(), IAction.AS_RADIO_BUTTON); + super(Utils.getLabel(provider), IAction.AS_RADIO_BUTTON); this.configuration = configuration; this.provider = provider; } @@ -38,7 +39,7 @@ public class ShowModelProviderAction extends Action { provider.getDescriptor().getId()); configuration.setProperty( ISynchronizePageConfiguration.P_PAGE_DESCRIPTION, - NLS.bind(TeamUIMessages.ShowModelProviderAction_0, new String[] {provider.getDescriptor().getLabel(), configuration.getParticipant().getName()})); + NLS.bind(TeamUIMessages.ShowModelProviderAction_0, new String[] {Utils.getLabel(provider), configuration.getParticipant().getName()})); } public String getProviderId() { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java index d5bf0322e..a0c123b33 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeLabelProvider.java @@ -151,13 +151,7 @@ public abstract class AbstractSynchronizeLabelProvider implements ILabelProvider if (base == null || base.length() == 0) { if (element instanceof ModelProvider) { ModelProvider provider = (ModelProvider) element; - ResourceMapping mapping = Utils.getResourceMapping(provider); - if (mapping != null) { - base = Utils.getLabel(mapping); - if (base != null && base.length() > 0) - return base; - } - base = provider.getDescriptor().getLabel(); + base = Utils.getLabel(provider); } } return base; |