Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-01-31 22:33:22 +0000
committerjames2002-01-31 22:33:22 +0000
commit2815f3b361c03d664311ea51d421734cb22c68b8 (patch)
tree32533c3a43804b88452323f9ba54ec077dc76e2a
parentb8d1c7c813447ddeef0445b101454f5e9cd632eb (diff)
downloadeclipse.platform.team-2815f3b361c03d664311ea51d421734cb22c68b8.tar.gz
eclipse.platform.team-2815f3b361c03d664311ea51d421734cb22c68b8.tar.xz
eclipse.platform.team-2815f3b361c03d664311ea51d421734cb22c68b8.zip
8889: Modules preference should move to repo view
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java51
2 files changed, 31 insertions, 35 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index d3e1bb542..9e5973cd3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -43,7 +43,6 @@ public class CVSPreferencesPage
private Button pruneEmptyDirectoriesField;
private Text timeoutValue;
private Combo quietnessCombo;
- private Button showModulesButton;
/**
* Utility method that creates a combo box
@@ -132,8 +131,6 @@ public class CVSPreferencesPage
createLabel(composite, Policy.bind("CVSPreferencePage.quietness"));
quietnessCombo = createCombo(composite);
- showModulesButton = createCheckBox(composite, Policy.bind("CVSPreferencePage.showModules"));
-
initializeValues();
return composite;
@@ -179,7 +176,6 @@ public class CVSPreferencesPage
quietnessCombo.add(Policy.bind("CVSPreferencePage.somewhatquiet"));
quietnessCombo.add(Policy.bind("CVSPreferencePage.reallyquiet"));
quietnessCombo.select(store.getInt(ICVSUIConstants.PREF_QUIETNESS));
- showModulesButton.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES));
}
/**
@@ -200,8 +196,6 @@ public class CVSPreferencesPage
IPreferenceStore store = getPreferenceStore();
- boolean refreshRequired = store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES) != showModulesButton.getSelection();
-
store.setValue(
ICVSUIConstants.PREF_PRUNE_EMPTY_DIRECTORIES,
pruneEmptyDirectoriesField.getSelection());
@@ -211,9 +205,6 @@ public class CVSPreferencesPage
store.setValue(
ICVSUIConstants.PREF_QUIETNESS,
quietnessCombo.getSelectionIndex());
- store.setValue(
- ICVSUIConstants.PREF_SHOW_MODULES,
- showModulesButton.getSelection());
CVSProviderPlugin.getPlugin().setPruneEmptyDirectories(
store.getBoolean(ICVSUIConstants.PREF_PRUNE_EMPTY_DIRECTORIES));
@@ -222,10 +213,6 @@ public class CVSPreferencesPage
CVSProviderPlugin.getPlugin().setQuietness(
getQuietnessOptionFor(store.getInt(ICVSUIConstants.PREF_QUIETNESS)));
- if (refreshRequired) {
- RepositoriesView.refreshAll();
- }
-
return true;
}
@@ -240,8 +227,6 @@ public class CVSPreferencesPage
store.getDefaultBoolean(ICVSUIConstants.PREF_PRUNE_EMPTY_DIRECTORIES));
timeoutValue.setText(new Integer(store.getDefaultInt(ICVSUIConstants.PREF_TIMEOUT)).toString());
quietnessCombo.select(store.getDefaultInt(ICVSUIConstants.PREF_QUIETNESS));
- showModulesButton.setSelection(
- store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_MODULES));
}
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java
index b94f41ee4..52daa6763 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java
@@ -30,6 +30,7 @@ import org.eclipse.team.internal.ccvs.ui.model.AllRootsElement;
import org.eclipse.team.internal.ccvs.ui.model.BranchTag;
import org.eclipse.team.internal.ccvs.ui.model.RemoteContentProvider;
import org.eclipse.team.internal.ccvs.ui.wizards.NewLocationWizard;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
@@ -52,11 +53,14 @@ public class RepositoriesView extends ViewPart {
// The root
private AllRootsElement root;
- private OpenRemoteFileAction openAction;
-
// Drill down adapter
private DrillDownAdapter drillPart;
+ // Actions
+ private Action showFoldersAction;
+ private Action showModulesAction;
+ private OpenRemoteFileAction openAction;
+
IRepositoryListener listener = new IRepositoryListener() {
public void repositoryAdded(ICVSRepositoryLocation root) {
refresh();
@@ -135,7 +139,8 @@ public class RepositoriesView extends ViewPart {
getSite().registerContextMenu(menuMgr, viewer);
// Create the local tool bar
- IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
+ IActionBars bars = getViewSite().getActionBars();
+ IToolBarManager tbm = bars.getToolBarManager();
drillPart.addNavigationActions(tbm);
tbm.add(refreshAction);
tbm.update(false);
@@ -147,6 +152,29 @@ public class RepositoriesView extends ViewPart {
handleDoubleClick(e);
}
});
+
+ // Add module toggling to the local pull-down menu
+ IMenuManager mgr = bars.getMenuManager();
+ showFoldersAction = new Action("Show Folders") {
+ public void run() {
+ CVSUIPlugin.getPlugin().getPreferenceStore().setValue(ICVSUIConstants.PREF_SHOW_MODULES, false);
+ showModulesAction.setChecked(false);
+ viewer.refresh();
+ }
+ };
+ showModulesAction = new Action("Show Modules") {
+ public void run() {
+ CVSUIPlugin.getPlugin().getPreferenceStore().setValue(ICVSUIConstants.PREF_SHOW_MODULES, true);
+ showFoldersAction.setChecked(false);
+ viewer.refresh();
+ }
+ };
+ boolean showModules = CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_SHOW_MODULES);
+ showFoldersAction.setChecked(!showModules);
+ showModulesAction.setChecked(showModules);
+ mgr.add(showFoldersAction);
+ mgr.add(showModulesAction);
+ bars.updateActionBars();
}
/*
@@ -206,21 +234,4 @@ public class RepositoriesView extends ViewPart {
public void setFocus() {
viewer.getControl().setFocus();
}
-
- /**
- * Ask all open repositories views to refresh.
- */
- public static void refreshAll() {
- IWorkbench workbench = CVSUIPlugin.getPlugin().getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- IWorkbenchPage[] pages = windows[i].getPages();
- for (int j = 0; j < pages.length; j++) {
- RepositoriesView view = (RepositoriesView)pages[j].findView(VIEW_ID);
- if (view != null) {
- view.viewer.refresh();
- }
- }
- }
- }
} \ No newline at end of file

Back to the top