Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 22666 Details for
Bug 98771
(PatchAttached)[Decorations] Add variable for CVS repository label to CVS text decorations.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch implementing this functionality
cvs_repo_label.patch (text/plain), 31.75 KB, created by
Eugene Kuleshov
on 2005-06-09 00:29:37 EDT
(
hide
)
Description:
Patch implementing this functionality
Filename:
MIME Type:
Creator:
Eugene Kuleshov
Created:
2005-06-09 00:29:37 EDT
Size:
31.75 KB
patch
obsolete
>Index: src/org/eclipse/team/internal/ccvs/ui/CVSDecoration.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoration.java,v >retrieving revision 1.9 >diff -u -r1.9 CVSDecoration.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSDecoration.java 18 Mar 2005 20:25:41 -0000 1.9 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSDecoration.java 9 Jun 2005 04:28:12 -0000 >@@ -4,7 +4,7 @@ > * 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: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -20,6 +20,8 @@ > import org.eclipse.swt.graphics.*; > import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; > import org.eclipse.team.internal.ccvs.core.util.Assert; >+import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager; >+import org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot; > import org.eclipse.team.internal.ui.TeamUIPlugin; > import org.eclipse.team.ui.ISharedImages; > import org.eclipse.ui.PlatformUI; >@@ -35,13 +37,13 @@ > * decoration APIs. As such a client can convert between them using helpers > * defined in this class. > * </p> >- * TODO: >+ * TODO: > * profile > * add colors and fonts to preferences instead of being hard coded > * what to do with CVSDecorationConfiguration class? > * preference page externalizations > * preference page preview should update when theme changes >- * >+ * > * @since 3.1 > */ > public class CVSDecoration { >@@ -53,7 +55,7 @@ > private Color bkgColor; > private Color fgColor; > private Font font; >- >+ > // Properties > private int resourceType = IResource.FILE; > private boolean watchEditEnabled = false; >@@ -78,7 +80,7 @@ > private String dirtyTextIndicator; > private String addedTextIndicator; > private String resourceName; >- >+ > // Images cached for better performance > private static ImageDescriptor dirty; > private static ImageDescriptor checkedIn; >@@ -87,7 +89,7 @@ > private static ImageDescriptor merged; > private static ImageDescriptor newResource; > private static ImageDescriptor edited; >- >+ > // List of preferences used to configure the decorations that > // are applied. > private Preferences preferences; >@@ -131,7 +133,7 @@ > // TODO: for efficiency don't look up a pref until its needed > IPreferenceStore store = getStore(); > Preferences prefs = new Preferences(); >- >+ > prefs.setValue(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, store.getBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); > prefs.setValue(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, store.getBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); > prefs.setValue(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION, store.getBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); >@@ -140,7 +142,7 @@ > prefs.setValue(ICVSUIConstants.PREF_DIRTY_FLAG, store.getString(ICVSUIConstants.PREF_DIRTY_FLAG)); > prefs.setValue(ICVSUIConstants.PREF_ADDED_FLAG, store.getString(ICVSUIConstants.PREF_ADDED_FLAG)); > prefs.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, store.getString(ICVSUIConstants.PREF_USE_FONT_DECORATORS)); >- >+ > initialize(resourceName, prefs, store.getString(ICVSUIConstants.PREF_FILETEXT_DECORATION), store.getString(ICVSUIConstants.PREF_FOLDERTEXT_DECORATION), store.getString(ICVSUIConstants.PREF_PROJECTTEXT_DECORATION)); > } > >@@ -203,7 +205,7 @@ > public String getSuffix() { > return suffix; > } >- >+ > public void setResourceType(int type) { > this.resourceType = type; > } >@@ -247,7 +249,7 @@ > } else if(isHasRemote()){ > bindings.put(CVSDecoratorConfiguration.FILE_REVISION, getRevision()); > bindings.put(CVSDecoratorConfiguration.RESOURCE_TAG, getTag()); >- } >+ } > bindings.put(CVSDecoratorConfiguration.RESOURCE_NAME, getResourceName()); > bindings.put(CVSDecoratorConfiguration.FILE_KEYWORD, getKeywordSubstitution()); > if (resourceType != IResource.FILE && location != null) { >@@ -256,6 +258,15 @@ > bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, location.getUsername()); > bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, location.getRootDirectory()); > bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, repository); >+ >+ RepositoryManager repositoryManager = CVSUIPlugin.getPlugin().getRepositoryManager(); >+ RepositoryRoot root = repositoryManager.getRepositoryRootFor(location); >+ CVSUIPlugin.getPlugin().getRepositoryManager(); >+ String label = root.getName(); >+ if (label == null) { >+ label = location.getLocation(true); >+ } >+ bindings.put(CVSDecoratorConfiguration.REMOTELOCATION_LABEL, label); > } > CVSDecoratorConfiguration.decorate(this, getTextFormatter(), bindings); > } >@@ -286,12 +297,12 @@ > } > //nothing matched > return null; >- } >- >+ } >+ > private void computeColorsAndFonts() { > if (!preferences.getBoolean(ICVSUIConstants.PREF_USE_FONT_DECORATORS)) > return; >- >+ > ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); > if(isIgnored()) { > setBackgroundColor(current.getColorRegistry().get(CVSDecoratorConfiguration.IGNORED_BACKGROUND_COLOR)); >Index: src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java,v >retrieving revision 1.20 >diff -u -r1.20 CVSDecoratorConfiguration.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java 18 Mar 2005 20:25:41 -0000 1.20 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorConfiguration.java 9 Jun 2005 04:28:12 -0000 >@@ -4,7 +4,7 @@ > * 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: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -15,25 +15,26 @@ > > public class CVSDecoratorConfiguration { > >- // bindings for >+ // bindings for > public static final String RESOURCE_NAME = "name"; //$NON-NLS-1$ > public static final String RESOURCE_TAG = "tag"; //$NON-NLS-1$ > public static final String FILE_REVISION = "revision"; //$NON-NLS-1$ > public static final String FILE_KEYWORD = "keyword"; //$NON-NLS-1$ >- >+ > // bindings for repository location > public static final String REMOTELOCATION_METHOD = "method"; //$NON-NLS-1$ > public static final String REMOTELOCATION_USER = "user"; //$NON-NLS-1$ > public static final String REMOTELOCATION_HOST = "host"; //$NON-NLS-1$ > public static final String REMOTELOCATION_ROOT = "root"; //$NON-NLS-1$ > public static final String REMOTELOCATION_REPOSITORY = "repository"; //$NON-NLS-1$ >- >+ public static final String REMOTELOCATION_LABEL = "label"; //$NON-NLS-1$ >+ > // bindings for resource states > public static final String DIRTY_FLAG = "dirty_flag"; //$NON-NLS-1$ > public static final String ADDED_FLAG = "added_flag"; //$NON-NLS-1$ > public static final String DEFAULT_DIRTY_FLAG = ">"; //$NON-NLS-1$ > public static final String DEFAULT_ADDED_FLAG = "*"; //$NON-NLS-1$ >- >+ > // default text decoration formats > public static final String DEFAULT_FILETEXTFORMAT = "{dirty_flag}{name} {revision} {tag} ({keyword})"; //$NON-NLS-1$ > public static final String DEFAULT_FOLDERTEXTFORMAT = "{dirty_flag}{name} {tag}"; //$NON-NLS-1$ >@@ -42,7 +43,7 @@ > // prefix characters that can be removed if the following binding is not found > private static final char KEYWORD_SEPCOLON = ':'; > private static final char KEYWORD_SEPAT = '@'; >- >+ > // font and color definition ids > public static final String OUTGOING_CHANGE_FOREGROUND_COLOR = "org.eclipse.team.cvs.ui.fontsandcolors.outgoing_change_foreground_color"; //$NON-NLS-1$ > public static final String OUTGOING_CHANGE_BACKGROUND_COLOR = "org.eclipse.team.cvs.ui.fontsandcolors.outgoing_change_background_color"; //$NON-NLS-1$ >@@ -50,12 +51,12 @@ > public static final String IGNORED_FOREGROUND_COLOR = "org.eclipse.team.cvs.ui.fontsandcolors.ignored_resource_foreground_color"; //$NON-NLS-1$ > public static final String IGNORED_BACKGROUND_COLOR = "org.eclipse.team.cvs.ui.fontsandcolors.ignored_resource_background_color"; //$NON-NLS-1$ > public static final String IGNORED_FONT = "org.eclipse.team.cvs.ui.fontsandcolors.ignored_resource_font"; //$NON-NLS-1$ >- >+ > public static void decorate(CVSDecoration decoration, String format, Map bindings) { > StringBuffer prefix = new StringBuffer(80); > StringBuffer suffix = new StringBuffer(80); > StringBuffer output = prefix; >- >+ > int length = format.length(); > int start = -1; > int end = length; >@@ -66,7 +67,7 @@ > String key = format.substring(end + 1, start); > String s; > >- //We use the RESOURCE_NAME key to determine if we are doing the prefix or suffix. The name isn't actually part of either. >+ //We use the RESOURCE_NAME key to determine if we are doing the prefix or suffix. The name isn't actually part of either. > if(key.equals(RESOURCE_NAME)) { > output = suffix; > s = null; >@@ -82,7 +83,7 @@ > if(curLength>0) { > char c = output.charAt(curLength - 1); > if(c == KEYWORD_SEPCOLON || c == KEYWORD_SEPAT) { >- output.deleteCharAt(curLength - 1); >+ output.deleteCharAt(curLength - 1); > } > } > } >@@ -95,7 +96,7 @@ > break; > } > } >- >+ > if (prefix.length() != 0) { > decoration.addPrefix(prefix.toString()); > } >Index: src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java,v >retrieving revision 1.43 >diff -u -r1.43 CVSDecoratorPreferencesPage.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java 7 Jun 2005 16:07:22 -0000 1.43 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSDecoratorPreferencesPage.java 9 Jun 2005 04:28:12 -0000 >@@ -4,7 +4,7 @@ > * 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: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -42,12 +42,12 @@ > public class CVSDecoratorPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage { > > private static class PreviewFile { >- >+ > public final String name, tag, mode; > public final int type; > public final boolean added, dirty, hasRemote, ignored, newResource; > public Collection children; >- >+ > public PreviewFile(String name, int type, boolean added, boolean newResource, boolean dirty, boolean ignored, boolean hasRemote, String mode, String tag) { > this.name= name; > this.type= type; >@@ -60,7 +60,7 @@ > this.tag= tag != null ? tag : ""; //$NON-NLS-1$ > this.children= Collections.EMPTY_LIST; > } >- >+ > public void configureDecoration(CVSDecoration decoration) { > decoration.setResourceType(type); > decoration.setAdded(added); >@@ -72,29 +72,29 @@ > decoration.setKeywordSubstitution(mode); > } > } >- >+ > private static class FormatEditor extends SelectionAdapter { > private final Text fText; > private final Map fBindings; > private final String fKey; >- >+ > public FormatEditor(Composite composite, String title, String buttonText, Map bindings, String key) { >- >+ > fKey= key; > fBindings= bindings; >- >+ > final Label label= SWTUtils.createLabel(composite, title); > label.setLayoutData(SWTUtils.createGridData(SWT.DEFAULT, SWT.DEFAULT, false, false)); >- >+ > fText= SWTUtils.createText(composite); >- >+ > final Button button = new Button(composite, SWT.NONE); > button.setText(buttonText); > button.setLayoutData(new GridData()); > > button.addSelectionListener(this); > } >- >+ > public void addModifyListener(ModifyListener listener) { > fText.addModifyListener(listener); > } >@@ -102,15 +102,15 @@ > public String getText() { > return fText.getText(); > } >- >+ > public void widgetSelected(SelectionEvent e) { >- >+ > final ILabelProvider labelProvider = new LabelProvider() { > public String getText(Object element) { > return ((Map.Entry)element).getKey() + " - " + ((Map.Entry)element).getValue(); //$NON-NLS-1$ > } > }; >- >+ > final IStructuredContentProvider contentsProvider = new IStructuredContentProvider() { > public Object[] getElements(Object inputElement) { > return ((Collection)inputElement).toArray(); >@@ -118,7 +118,7 @@ > public void dispose() {} > public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} > }; >- >+ > final ListSelectionDialog dialog= new ListSelectionDialog( > fText.getShell(), > fBindings.entrySet(), >@@ -128,18 +128,18 @@ > dialog.setTitle(CVSUIMessages.CVSDecoratorPreferencesPage_1); //$NON-NLS-1$ > if (dialog.open() != Window.OK) > return; >- >+ > Object[] result = dialog.getResult(); >- >+ > for (int i = 0; i < result.length; i++) { > fText.insert("{"+((Map.Entry)result[i]).getKey() +"}"); //$NON-NLS-1$ //$NON-NLS-2$ >- } >+ } > } > > public void performOk(IPreferenceStore store) { > store.setValue(fKey, fText.getText()); > } >- >+ > public void performDefaults(IPreferenceStore store) { > store.setToDefault(fKey); > fText.setText(store.getDefaultString(fKey)); >@@ -149,9 +149,9 @@ > fText.setText(store.getString(fKey)); > } > } >- >+ > private abstract class Tab extends Observable { >- >+ > public abstract void initializeValues(IPreferenceStore store); > public abstract void performDefaults(IPreferenceStore store); > public abstract void performOk(IPreferenceStore store); >@@ -160,56 +160,56 @@ > } > > private class IconDecoratorTab extends Tab implements SelectionListener { >- >+ > private final Button fDirty, fHasRemote, fAdded, fNewResource; >- >+ > public IconDecoratorTab(TabFolder parent) { > > final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT); >- >+ > fDirty= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_2); //$NON-NLS-1$ > fDirty.addSelectionListener(this); >- >+ > fHasRemote= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_3); //$NON-NLS-1$ > fHasRemote.addSelectionListener(this); >- >+ > fAdded= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_4); //$NON-NLS-1$ > fAdded.addSelectionListener(this); >- >+ > fNewResource= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_5); //$NON-NLS-1$ >- fNewResource.addSelectionListener(this); >- >+ fNewResource.addSelectionListener(this); >+ > final TabItem item= new TabItem(parent, SWT.NONE); > item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_6); //$NON-NLS-1$ >- item.setControl(composite); >+ item.setControl(composite); > } >- >+ > public void widgetSelected(SelectionEvent e) { > setChanged(); > notifyObservers(); > } >- >+ > public void initializeValues(IPreferenceStore store) { > fDirty.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); > fAdded.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); > fHasRemote.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); > fNewResource.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); > } >- >+ > public void performOk(IPreferenceStore store) { > store.setValue(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, fDirty.getSelection()); > store.setValue(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, fAdded.getSelection()); > store.setValue(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION, fHasRemote.getSelection()); > store.setValue(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION, fNewResource.getSelection()); > } >- >+ > public void performDefaults(IPreferenceStore store) { > fDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); > fAdded.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); > fHasRemote.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); > fNewResource.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); > } >- >+ > public void setPreferences(Preferences prefs) { > prefs.setDefault(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, fDirty.getSelection()); > prefs.setDefault(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, fAdded.getSelection()); >@@ -219,39 +219,39 @@ > > public void widgetDefaultSelected(SelectionEvent e) { > } >- } >- >+ } >+ > private class TextDecoratorTab extends Tab implements ModifyListener { >- >+ > private final FormatEditor fFileDecoration; >- private final FormatEditor fFolderDecoration; >+ private final FormatEditor fFolderDecoration; > private final FormatEditor fProjectDecoration; >- >+ > private final Text dirtyFlag; > private final Text addedFlag; >- >+ > public TextDecoratorTab(TabFolder parent) { >- >+ > final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT, 3); > Dialog.applyDialogFont(composite); >- >+ > fFileDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_7, CVSUIMessages.CVSDecoratorPreferencesPage_8, BINDINGS, ICVSUIConstants.PREF_FILETEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ > fFolderDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_9, CVSUIMessages.CVSDecoratorPreferencesPage_10, FOLDER_BINDINGS, ICVSUIConstants.PREF_FOLDERTEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ > fProjectDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_11, CVSUIMessages.CVSDecoratorPreferencesPage_12, FOLDER_BINDINGS, ICVSUIConstants.PREF_PROJECTTEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ >- >+ > fFileDecoration.addModifyListener(this); > fFolderDecoration.addModifyListener(this); > fProjectDecoration.addModifyListener(this); > >- SWTUtils.createPlaceholder(composite, 1, 3); >+ SWTUtils.createPlaceholder(composite, 1, 3); > final Label dirtyLabel= SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_13, 1); //$NON-NLS-1$ > dirtyLabel.setLayoutData(new GridData()); >- >+ > dirtyFlag = new Text(composite, SWT.BORDER); > dirtyFlag.setLayoutData(SWTUtils.createHFillGridData(1)); > dirtyFlag.addModifyListener(this); > SWTUtils.createPlaceholder(composite, 1, 1); >- >+ > > final Label addedLabel= SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_14, 1); //$NON-NLS-1$ > addedLabel.setLayoutData(new GridData()); >@@ -260,14 +260,14 @@ > addedFlag.setLayoutData(SWTUtils.createHFillGridData(1)); > addedFlag.addModifyListener(this); > SWTUtils.createPlaceholder(composite, 1, 1); >- >+ > SWTUtils.createPlaceholder(composite, 1, 3); > > final TabItem item= new TabItem(parent, SWT.NONE); > item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_15); //$NON-NLS-1$ >- item.setControl(composite); >+ item.setControl(composite); > } >- >+ > public void initializeValues(IPreferenceStore store) { > fFileDecoration.initializeValue(store); > fFolderDecoration.initializeValue(store); >@@ -275,7 +275,7 @@ > addedFlag.setText(store.getString(ICVSUIConstants.PREF_ADDED_FLAG)); > dirtyFlag.setText(store.getString(ICVSUIConstants.PREF_DIRTY_FLAG)); > } >- >+ > public void performOk(IPreferenceStore store) { > fFileDecoration.performOk(store); > fFolderDecoration.performOk(store); >@@ -283,12 +283,12 @@ > store.setValue(ICVSUIConstants.PREF_ADDED_FLAG, addedFlag.getText()); > store.setValue(ICVSUIConstants.PREF_DIRTY_FLAG, dirtyFlag.getText()); > } >- >+ > public void performDefaults(IPreferenceStore store) { > fFileDecoration.performDefaults(store); > fFolderDecoration.performDefaults(store); > fProjectDecoration.performDefaults(store); >- >+ > addedFlag.setText(store.getDefaultString(ICVSUIConstants.PREF_ADDED_FLAG)); > dirtyFlag.setText(store.getDefaultString(ICVSUIConstants.PREF_DIRTY_FLAG)); > } >@@ -316,7 +316,7 @@ > prefs.setDefault(ICVSUIConstants.PREF_ADDED_FLAG, addedFlag.getText()); > } > } >- >+ > private class GeneralTab extends Tab implements SelectionListener { > private final Button fShowDirty; > private final Button fUseFontDecorations; >@@ -324,12 +324,12 @@ > public GeneralTab(TabFolder parent) { > final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT); > Dialog.applyDialogFont(composite); >- >+ > SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSDecoratorPreferencesPage_36, CVSUIMessages.CVSDecoratorPreferencesPage_37); //$NON-NLS-1$ //$NON-NLS-2$ >- >+ > fShowDirty= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_16); //$NON-NLS-1$ > SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_17); //$NON-NLS-1$ >- >+ > fUseFontDecorations= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_18); //$NON-NLS-1$ > > SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSDecoratorPreferencesPage_19, CVSUIMessages.CVSDecoratorPreferencesPage_20); //$NON-NLS-1$ //$NON-NLS-2$ >@@ -339,14 +339,14 @@ > > final TabItem item= new TabItem(parent, SWT.NONE); > item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_21); //$NON-NLS-1$ >- item.setControl(composite); >+ item.setControl(composite); > } > > public void widgetSelected(SelectionEvent e) { > setChanged(); > notifyObservers(); > } >- >+ > public void widgetDefaultSelected(SelectionEvent e) { > } > >@@ -359,22 +359,22 @@ > fShowDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY)); > fUseFontDecorations.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_USE_FONT_DECORATORS)); > } >- >+ > public void performOk(IPreferenceStore store) { > store.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, fShowDirty.getSelection()); > store.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, fUseFontDecorations.getSelection()); > } >- >+ > public void setPreferences(Preferences preferences) { > preferences.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, fShowDirty.getSelection()); > preferences.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, fUseFontDecorations.getSelection()); > } > } >- >+ > public class Preview extends LabelProvider implements Observer, ITreeContentProvider { >- >+ > private final ResourceManager fImageCache; >- private final TreeViewer fViewer; >+ private final TreeViewer fViewer; > > public Preview(Composite composite) { > SWTUtils.createLabel(composite, "Previe&w:"); >@@ -386,15 +386,15 @@ > fViewer.setInput(ROOT); > fViewer.expandAll(); > } >- >+ > public void refresh() { > fViewer.refresh(true); > } >- >+ > public void update(Observable o, Object arg) { > refresh(); > } >- >+ > public Object[] getChildren(Object parentElement) { > return ((PreviewFile)parentElement).children.toArray(); > } >@@ -421,15 +421,15 @@ > public Color getBackground(Object element) { > return getDecoration(element).getBackgroundColor(); > } >- >+ > public Color getForeground(Object element) { > return getDecoration(element).getForegroundColor(); > } >- >+ > public Font getFont(Object element) { > return getDecoration(element).getFont(); > } >- >+ > public String getText(Object element) { > final CVSDecoration decoration = getDecoration(element); > final StringBuffer buffer = new StringBuffer(); >@@ -442,14 +442,14 @@ > buffer.append(suffix); > return buffer.toString(); > } >- >+ > public CVSDecoration getDecoration(Object element) { > final CVSDecoration decoration = buildDecoration((PreviewFile)element); > ((PreviewFile)element).configureDecoration(decoration); > decoration.compute(); > return decoration; > } >- >+ > public Image getImage(Object element) { > final String s; > switch (((PreviewFile)element).type) { >@@ -472,11 +472,11 @@ > return null; > } > } >- >+ > private static class ThemeListener implements IPropertyChangeListener { > > private final Preview fPreview; >- >+ > ThemeListener(Preview preview) { > fPreview= preview; > } >@@ -484,7 +484,7 @@ > fPreview.refresh(); > } > } >- >+ > protected static final Collection ROOT; > protected static final Map BINDINGS; > protected static final Map FOLDER_BINDINGS; >@@ -497,7 +497,7 @@ > BINDINGS.put(CVSDecoratorConfiguration.FILE_REVISION, CVSUIMessages.CVSDecoratorPreferencesPage_25); //$NON-NLS-1$ > BINDINGS.put(CVSDecoratorConfiguration.DIRTY_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_26); //$NON-NLS-1$ > BINDINGS.put(CVSDecoratorConfiguration.ADDED_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_27); //$NON-NLS-1$ >- >+ > FOLDER_BINDINGS= new HashMap(); > FOLDER_BINDINGS.put(CVSDecoratorConfiguration.RESOURCE_NAME, CVSUIMessages.CVSDecoratorPreferencesPage_28); //$NON-NLS-1$ > FOLDER_BINDINGS.put(CVSDecoratorConfiguration.RESOURCE_TAG, CVSUIMessages.CVSDecoratorPreferencesPage_29); //$NON-NLS-1$ >@@ -506,8 +506,9 @@ > FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, CVSUIMessages.CVSDecoratorPreferencesPage_32); //$NON-NLS-1$ > FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, CVSUIMessages.CVSDecoratorPreferencesPage_33); //$NON-NLS-1$ > FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, CVSUIMessages.CVSDecoratorPreferencesPage_34); //$NON-NLS-1$ >+ FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_LABEL, CVSUIMessages.CVSDecoratorPreferencesPage_38); //$NON-NLS-1$ > FOLDER_BINDINGS.put(CVSDecoratorConfiguration.DIRTY_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_35); //$NON-NLS-1$ >- >+ > final PreviewFile project= new PreviewFile("Project", IResource.PROJECT, false, false, false, false, true, null, "v1_0"); //$NON-NLS-1$ //$NON-NLS-2$ > final ArrayList children= new ArrayList(); > children.add(new PreviewFile("Folder", IResource.FOLDER, false, false, false, false, true, null, null)); //$NON-NLS-1$ >@@ -521,32 +522,32 @@ > ROOT= Collections.singleton(project); > } > >- >+ > private TextDecoratorTab fTextTab; > private IconDecoratorTab fIconTab; > private GeneralTab fGeneralTab; > > private Preview fPreview; > private ThemeListener fThemeListener; >- >+ > protected Control createContents(Composite parent) { >- >+ > final Composite composite= SWTUtils.createHVFillComposite(parent, SWTUtils.MARGINS_NONE); >- >+ > final Composite folderComposite= SWTUtils.createHFillComposite(composite, SWTUtils.MARGINS_NONE); >- >+ > // create a tab folder for the page > final TabFolder tabFolder = new TabFolder(folderComposite, SWT.NONE); > tabFolder.setLayout(new TabFolderLayout()); > tabFolder.setLayoutData(SWTUtils.createHFillGridData()); >- >+ > // text decoration options > fGeneralTab= new GeneralTab(tabFolder); > fTextTab= new TextDecoratorTab(tabFolder); > fIconTab= new IconDecoratorTab(tabFolder); > > fPreview= new Preview(composite); >- >+ > fTextTab.addObserver(fPreview); > fIconTab.addObserver(fPreview); > fGeneralTab.addObserver(fPreview); >@@ -554,19 +555,19 @@ > initializeValues(); > PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.DECORATORS_PREFERENCE_PAGE); > Dialog.applyDialogFont(parent); >- >+ > PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener= new ThemeListener(fPreview)); >- >+ > return tabFolder; > } >- >+ > public void dispose() { > if (fThemeListener != null) > PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(fThemeListener); > if (fPreview != null) > fPreview.dispose(); > } >- >+ > /** > * Initializes states of the controls from the preference store. > */ >@@ -608,7 +609,7 @@ > */ > protected void performDefaults() { > final IPreferenceStore store = getPreferenceStore(); >- >+ > fTextTab.performDefaults(store); > fIconTab.performDefaults(store); > fGeneralTab.performDefaults(store); >@@ -626,17 +627,17 @@ > protected IPreferenceStore doGetPreferenceStore() { > return CVSUIPlugin.getPlugin().getPreferenceStore(); > } >- >- >+ >+ > public CVSDecoration buildDecoration(PreviewFile file) { > final Preferences prefs = new Preferences(); >- >+ > fIconTab.setPreferences(prefs); > fTextTab.setPreferences(prefs); > fGeneralTab.setPreferences(prefs); >- >+ > final CVSDecoration decoration= new CVSDecoration(file.name, prefs, fTextTab.getFileTextFormat(), fTextTab.getFolderTextFormat(), fTextTab.getProjectTextFormat()); >- >+ > decoration.setKeywordSubstitution(Command.KSUBST_TEXT.getShortDisplayText()); > decoration.setRevision("1.45"); //$NON-NLS-1$ > try { >Index: src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java,v >retrieving revision 1.9 >diff -u -r1.9 CVSUIMessages.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java 31 May 2005 14:54:35 -0000 1.9 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java 9 Jun 2005 04:28:12 -0000 >@@ -3,8 +3,8 @@ > * 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: >+ * >+ * Contributors: > * IBM - Initial API and implementation > **********************************************************************/ > package org.eclipse.team.internal.ccvs.ui; >@@ -146,6 +146,7 @@ > public static String CVSDecoratorPreferencesPage_35; > public static String CVSDecoratorPreferencesPage_36; > public static String CVSDecoratorPreferencesPage_37; >+ public static String CVSDecoratorPreferencesPage_38; // repository label > > public static String CVSFilePropertiesPage_ignored; > public static String CVSFilePropertiesPage_notManaged; >Index: src/org/eclipse/team/internal/ccvs/ui/messages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties,v >retrieving revision 1.434 >diff -u -r1.434 messages.properties >--- src/org/eclipse/team/internal/ccvs/ui/messages.properties 7 Jun 2005 15:47:43 -0000 1.434 >+++ src/org/eclipse/team/internal/ccvs/ui/messages.properties 9 Jun 2005 04:28:12 -0000 >@@ -137,6 +137,7 @@ > CVSDecoratorPreferencesPage_35=flag indicating that the folder has a child resource with outgoing changes > CVSDecoratorPreferencesPage_36=org.eclipse.ui.preferencePages.Decorators > CVSDecoratorPreferencesPage_37=See <a>''{0}''</a> to enable CVS decorations. >+CVSDecoratorPreferencesPage_38=the repository label > > > CVSFilePropertiesPage_ignored=The file is ignored by CVS.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 98771
: 22666