Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-01-31 22:11:59 +0000
committerjames2002-01-31 22:11:59 +0000
commitb8d1c7c813447ddeef0445b101454f5e9cd632eb (patch)
treee32d33576ff925dcf9e018b48ce8b7f8c7c6a9a0
parentf86f73e7c7533eb31235585b0df7ff1cfd4ceb8c (diff)
downloadeclipse.platform.team-b8d1c7c813447ddeef0445b101454f5e9cd632eb.tar.gz
eclipse.platform.team-b8d1c7c813447ddeef0445b101454f5e9cd632eb.tar.xz
eclipse.platform.team-b8d1c7c813447ddeef0445b101454f5e9cd632eb.zip
Code clean-up
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java19
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddToWorkspaceAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchTag.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java4
6 files changed, 20 insertions, 22 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 c05525231..d3e1bb542 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,7 @@ public class CVSPreferencesPage
private Button pruneEmptyDirectoriesField;
private Text timeoutValue;
private Combo quietnessCombo;
- private Button showModulesField;
+ private Button showModulesButton;
/**
* Utility method that creates a combo box
@@ -132,10 +132,7 @@ public class CVSPreferencesPage
createLabel(composite, Policy.bind("CVSPreferencePage.quietness"));
quietnessCombo = createCombo(composite);
- showModulesField =
- createCheckBox(
- composite,
- Policy.bind("CVSPreferencePage.showModules"));
+ showModulesButton = createCheckBox(composite, Policy.bind("CVSPreferencePage.showModules"));
initializeValues();
@@ -182,8 +179,7 @@ public class CVSPreferencesPage
quietnessCombo.add(Policy.bind("CVSPreferencePage.somewhatquiet"));
quietnessCombo.add(Policy.bind("CVSPreferencePage.reallyquiet"));
quietnessCombo.select(store.getInt(ICVSUIConstants.PREF_QUIETNESS));
- showModulesField.setSelection(
- store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES));
+ showModulesButton.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES));
}
/**
@@ -204,10 +200,7 @@ public class CVSPreferencesPage
IPreferenceStore store = getPreferenceStore();
- boolean refreshRequired = false;
- if (store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES) != showModulesField.getSelection()) {
- refreshRequired = true;
- }
+ boolean refreshRequired = store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES) != showModulesButton.getSelection();
store.setValue(
ICVSUIConstants.PREF_PRUNE_EMPTY_DIRECTORIES,
@@ -220,7 +213,7 @@ public class CVSPreferencesPage
quietnessCombo.getSelectionIndex());
store.setValue(
ICVSUIConstants.PREF_SHOW_MODULES,
- showModulesField.getSelection());
+ showModulesButton.getSelection());
CVSProviderPlugin.getPlugin().setPruneEmptyDirectories(
store.getBoolean(ICVSUIConstants.PREF_PRUNE_EMPTY_DIRECTORIES));
@@ -247,7 +240,7 @@ 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));
- showModulesField.setSelection(
+ showModulesButton.setSelection(
store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_MODULES));
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index d68fceec0..11741c005 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -175,9 +175,6 @@ public class CVSUIPlugin extends AbstractUIPlugin {
CVSProviderPlugin.getPlugin().setQuietness(CVSPreferencesPage.getQuietnessOptionFor(store.getInt(ICVSUIConstants.PREF_QUIETNESS)));
}
- public boolean isModulesEnabled() {
- return getPreferenceStore().getBoolean(ICVSUIConstants.PREF_SHOW_MODULES);
- }
/**
* @see Plugin#startup()
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddToWorkspaceAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddToWorkspaceAction.java
index 1d272a38e..5a3e94cb8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddToWorkspaceAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddToWorkspaceAction.java
@@ -42,16 +42,18 @@ public class AddToWorkspaceAction extends TeamAction {
while (elements.hasNext()) {
Object next = elements.next();
if (next instanceof ICVSRemoteFolder) {
- if ( ! Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)next).getLocalOptions()))
+ if (!Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)next).getLocalOptions())) {
resources.add(next);
+ }
continue;
}
if (next instanceof IAdaptable) {
IAdaptable a = (IAdaptable) next;
Object adapter = a.getAdapter(ICVSRemoteFolder.class);
if (adapter instanceof ICVSRemoteFolder) {
- if ( ! Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)adapter).getLocalOptions()))
+ if (!Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)adapter).getLocalOptions())) {
resources.add(adapter);
+ }
continue;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
index 98db1d91d..c7fd6d09c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
@@ -43,16 +43,18 @@ public class CheckoutAsAction extends TeamAction {
while (elements.hasNext()) {
Object next = elements.next();
if (next instanceof ICVSRemoteFolder) {
- if ( ! Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)next).getLocalOptions()))
+ if (!Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)next).getLocalOptions())) {
resources.add(next);
+ }
continue;
}
if (next instanceof IAdaptable) {
IAdaptable a = (IAdaptable) next;
Object adapter = a.getAdapter(ICVSRemoteFolder.class);
if (adapter instanceof ICVSRemoteFolder) {
- if ( ! Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)adapter).getLocalOptions()))
+ if (!Checkout.ALIAS.isElementOf(((ICVSRemoteFolder)adapter).getLocalOptions())) {
resources.add(adapter);
+ }
continue;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchTag.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchTag.java
index 5271bf9fe..1b6651127 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchTag.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchTag.java
@@ -7,6 +7,7 @@ package org.eclipse.team.internal.ccvs.ui.model;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
@@ -56,7 +57,8 @@ public class BranchTag extends CVSModelElement implements IAdaptable {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
try {
- result[0] = root.members(tag, CVSUIPlugin.getPlugin().isModulesEnabled(), new NullProgressMonitor());
+ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ result[0] = root.members(tag, store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES), new NullProgressMonitor());
} catch (TeamException e) {
handle(e);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java
index 0024cd86a..4ffb3012f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/VersionCategory.java
@@ -7,6 +7,7 @@ package org.eclipse.team.internal.ccvs.ui.model;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
@@ -51,7 +52,8 @@ public class VersionCategory extends CVSModelElement implements IAdaptable {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
try {
- ICVSRemoteResource[] resources = repository.members(CVSTag.DEFAULT, CVSUIPlugin.getPlugin().isModulesEnabled(), new NullProgressMonitor());
+ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ ICVSRemoteResource[] resources = repository.members(CVSTag.DEFAULT, store.getBoolean(ICVSUIConstants.PREF_SHOW_MODULES), new NullProgressMonitor());
Object[] modules = new Object[resources.length];
for (int i = 0; i < resources.length; i++) {
modules[i] = new RemoteModule((ICVSRemoteFolder)resources[i], VersionCategory.this);

Back to the top