diff options
author | james | 2002-05-13 17:20:00 +0000 |
---|---|---|
committer | james | 2002-05-13 17:20:00 +0000 |
commit | 7d2f0aae04b1725bfb8a5dc786547eec0148f7fe (patch) | |
tree | 910ebe1fa64b33c09f00dfd5eef40bb014d5895d | |
parent | e2c35f7d9ae084d39b55df2ca82e22f82b8ae75b (diff) | |
download | eclipse.platform.team-7d2f0aae04b1725bfb8a5dc786547eec0148f7fe.tar.gz eclipse.platform.team-7d2f0aae04b1725bfb8a5dc786547eec0148f7fe.tar.xz eclipse.platform.team-7d2f0aae04b1725bfb8a5dc786547eec0148f7fe.zip |
15814: TeamUIPlugin should be internal
17 files changed, 26 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.core/plugin.xml b/bundles/org.eclipse.team.core/plugin.xml index 3826b708d..a48037367 100644 --- a/bundles/org.eclipse.team.core/plugin.xml +++ b/bundles/org.eclipse.team.core/plugin.xml @@ -5,7 +5,7 @@ name="%pluginName" version="1.9.0" provider-name="Object Technology International, Inc." - class="org.eclipse.team.core.TeamPlugin"> + class="org.eclipse.team.internal.core.TeamPlugin"> <requires> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.core.runtime"/> diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java index a18b3c432..f8ec74521 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java @@ -24,6 +24,7 @@ import org.eclipse.core.resources.team.IMoveDeleteHook; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.team.internal.core.*; import org.eclipse.team.internal.core.Policy; import org.eclipse.team.internal.core.simpleAccess.SimpleAccessOperations; diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java index 17c21ebb8..371373f71 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java @@ -40,6 +40,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.team.internal.core.*; import org.eclipse.team.internal.core.Policy; import org.eclipse.team.internal.core.StringMatcher; import org.omg.CORBA.UNKNOWN; @@ -498,10 +499,12 @@ public final class Team { } } - /* - * Initialize the registry, restoring its state + /** + * Initialize the registry, restoring its state. + * + * This method is called by the plug-in upon startup, clients should not call this method */ - static void startup() throws CoreException { + public static void startup() throws CoreException { try { table = new Hashtable(11); loadTextState(); @@ -512,10 +515,12 @@ public final class Team { } } - /* - * Shut down the registry, persisting its state + /** + * Shut down the registry, persisting its state. + * + * This method is called by the plug-in upon shutdown, clients should not call this method */ - static void shutdown() { + public static void shutdown() { saveTextState(); try { // make sure that we update our state on disk diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java index 8b6e6ec55..7576010e5 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java @@ -15,7 +15,6 @@ import org.eclipse.core.resources.IFileModificationValidator; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.team.core.TeamPlugin; public class DefaultFileModificationValidator implements IFileModificationValidator { private static final Status OK = new Status(Status.OK, TeamPlugin.ID, Status.OK, Policy.bind("FileModificationValidator.ok"), null); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileModificationValidatorManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileModificationValidatorManager.java index 8aab83d0d..9e5ddc619 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileModificationValidatorManager.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/FileModificationValidatorManager.java @@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.team.core.RepositoryProvider; -import org.eclipse.team.core.TeamPlugin; public class FileModificationValidatorManager implements IFileModificationValidator { private static final IFileModificationValidator DEFAULT_VALIDATOR = diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamPlugin.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java index 9c6d87e7d..83bb6ff7f 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/TeamPlugin.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/TeamPlugin.java @@ -8,15 +8,15 @@ * Contributors: * IBM - Initial API and implementation ******************************************************************************/ -package org.eclipse.team.core; +package org.eclipse.team.internal.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; +import org.eclipse.team.core.Team; import org.eclipse.team.core.target.TargetManager; -import org.eclipse.team.internal.core.Policy; /** * <code>TeamPlugin</code> is the plug-in runtime class for the Team diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/ITeamStatusConstants.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/ITeamStatusConstants.java index ed89f6bb8..189ca99ec 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/ITeamStatusConstants.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/ITeamStatusConstants.java @@ -3,8 +3,8 @@ package org.eclipse.team.internal.core.target; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.core.Policy; +import org.eclipse.team.internal.core.TeamPlugin; public interface ITeamStatusConstants { diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/Symmetria.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/Symmetria.java index d7c36b5f4..605109f05 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/Symmetria.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/Symmetria.java @@ -17,10 +17,10 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; import sun.security.action.GetLongAction; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.internal.core.Assert; +import org.eclipse.team.internal.core.TeamPlugin; /** * Synchronizes the given folder between the workspace and provider. diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java index 7364aed3d..bc26dacdd 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java @@ -23,6 +23,7 @@ import org.eclipse.team.core.*; import org.eclipse.team.core.target.*; import org.eclipse.team.internal.core.Policy; import org.eclipse.team.internal.core.Assert; +import org.eclipse.team.internal.core.TeamPlugin; public abstract class SynchronizedTargetProvider extends TargetProvider { diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java index a58801fef..98644b9da 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java @@ -11,7 +11,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.team.core.IIgnoreInfo; import org.eclipse.team.core.Team; -import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.ICVSFolder; import org.eclipse.team.internal.ccvs.core.ICVSResource; @@ -22,6 +21,7 @@ import org.eclipse.team.internal.ccvs.core.util.Assert; import org.eclipse.team.internal.ccvs.core.util.FileNameMatcher; import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; import org.eclipse.team.internal.ccvs.core.util.Util; +import org.eclipse.team.internal.core.TeamPlugin; /** * Represents handles to CVS resource on the local file system. Synchronization diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java index 3370d00af..71ded5a3a 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java @@ -54,7 +54,6 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.CVSTag; import org.eclipse.team.internal.ccvs.core.CVSTeamProvider; import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; @@ -63,6 +62,7 @@ import org.eclipse.team.internal.ccvs.core.ILogEntry; import org.eclipse.team.internal.ccvs.core.client.Command; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.ui.actions.CVSAction; +import org.eclipse.team.internal.core.TeamPlugin; import org.eclipse.ui.actions.WorkspaceModifyOperation; public class CVSCompareRevisionsInput extends CompareEditorInput { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java index 40e2ce479..66fa15468 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowHistoryAction.java @@ -17,12 +17,12 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.CVSTeamProvider; import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; import org.eclipse.team.internal.ccvs.ui.HistoryView; import org.eclipse.team.internal.ccvs.ui.Policy; +import org.eclipse.team.internal.core.TeamPlugin; import org.eclipse.team.internal.ui.actions.TeamAction; public class ShowHistoryAction extends TeamAction { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java index 807db4680..de9a7e09e 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java @@ -1,4 +1,4 @@ -package org.eclipse.team.internal.ui;
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.team.core.IIgnoreInfo;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+package org.eclipse.team.internal.ui;
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.team.core.IIgnoreInfo;
import org.eclipse.team.core.Team;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
public class IgnorePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
private Table ignoreTable;
private Button addButton;
private Button removeButton; public void init(IWorkbench workbench) {
setDescription(Policy.bind("IgnorePreferencePage.description")); //$NON-NLS-1$
}
/**
* Creates preference page controls on demand.
*
* @param parent the parent for the preference page
*/
protected Control createContents(Composite ancestor) {
noDefaultAndApplyButton();
Composite parent = new Composite(ancestor, SWT.NULL);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.numColumns = 2;
parent.setLayout(layout);
// set F1 help
//WorkbenchHelp.setHelp(parent, new DialogPageContextComputer (this, IVCMHelpContextIds.IGNORE_PREFERENCE_PAGE));
Label l1 = new Label(parent, SWT.NULL);
l1.setText(Policy.bind("IgnorePreferencePage.ignorePatterns")); //$NON-NLS-1$
GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 2;
l1.setLayoutData(data);
ignoreTable = new Table(parent, SWT.CHECK | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint= convertWidthInCharsToPixels(30);
ignoreTable.setLayoutData(gd);
ignoreTable.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
handleSelection();
}
});
Composite buttons = new Composite(parent, SWT.NULL);
buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
buttons.setLayout(new GridLayout());
addButton = new Button(buttons, SWT.PUSH);
addButton.setText(Policy.bind("IgnorePreferencePage.add")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, addButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
addButton.setLayoutData(data);
addButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
addIgnore();
}
});
removeButton = new Button(buttons, SWT.PUSH);
removeButton.setText(Policy.bind("IgnorePreferencePage.remove")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
removeButton.setLayoutData(data);
removeButton.setEnabled(false);
removeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removeIgnore();
}
});
fillTable();
return parent;
}
/**
* Do anything necessary because the OK button has been pressed.
*
* @return whether it is okay to close the preference page
*/
public boolean performOk() {
int count = ignoreTable.getItemCount();
String[] patterns = new String[count];
boolean[] enabled = new boolean[count];
TableItem[] items = ignoreTable.getItems();
for (int i = 0; i < count; i++) {
patterns[i] = items[i].getText();
enabled[i] = items[i].getChecked();
}
Team.setAllIgnores(patterns, enabled);
TeamUIPlugin.getPlugin().broadcastPropertyChange(new PropertyChangeEvent(TeamUIPlugin.getPlugin(), TeamUIPlugin.GLOBAL_IGNORES_CHANGED, null, null));
return true;
}
private void fillTable() {
IIgnoreInfo[] ignore = Team.getAllIgnores();
for (int i = 0; i < ignore.length; i++) {
IIgnoreInfo info = ignore[i];
TableItem item = new TableItem(ignoreTable, SWT.NONE);
item.setText(info.getPattern());
item.setChecked(info.getEnabled());
}
}
private void addIgnore() {
InputDialog dialog = new InputDialog(getShell(), Policy.bind("IgnorePreferencePage.enterPatternShort"), Policy.bind("IgnorePreferencePage.enterPatternLong"), null, null); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
String pattern = dialog.getValue();
if (pattern.equals("")) return; //$NON-NLS-1$
// Check if the item already exists
TableItem[] items = ignoreTable.getItems();
for (int i = 0; i < items.length; i++) {
if (items[i].getText().equals(pattern)) {
MessageDialog.openWarning(getShell(), Policy.bind("IgnorePreferencePage.patternExistsShort"), Policy.bind("IgnorePreferencePage.patternExistsLong")); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
}
TableItem item = new TableItem(ignoreTable, SWT.NONE);
item.setText(pattern);
item.setChecked(true);
}
private void removeIgnore() {
int[] selection = ignoreTable.getSelectionIndices();
ignoreTable.remove(selection);
}
private void handleSelection() {
if (ignoreTable.getSelectionCount() > 0) {
removeButton.setEnabled(true);
} else {
removeButton.setEnabled(false);
}
} } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetExportWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetExportWizard.java index 1c313dcb0..64b941b79 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetExportWizard.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ProjectSetExportWizard.java @@ -36,7 +36,7 @@ import org.eclipse.team.core.IProjectSetSerializer; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.Team; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; +import org.eclipse.team.internal.core.TeamPlugin; import org.eclipse.ui.IExportWizard; import org.eclipse.ui.IWorkbench; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java index f7ebfeefd..01b7cefa1 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java @@ -1 +1 @@ -package org.eclipse.team.internal.ui;
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.core.IFileTypeInfo;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* This preference page displays all patterns which determine whether a resource
* is to be treated as a text file or not. The page allows the user to add or
* remove entries from this table, and change their values from Text to Binary.
*/
public class TextPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
// Some string constants for display purposes
private static final String TEXT = Policy.bind("TextPreferencePage.text"); //$NON-NLS-1$
private static final String BINARY = Policy.bind("TextPreferencePage.binary"); //$NON-NLS-1$
// The name of the parameter in the file registry
private static final String TYPE = "type"; //$NON-NLS-1$
// The input for the table viewer
private List input;
// Widgets
private TableViewer viewer;
private Button removeButton;
private Button changeButton;
/**
* TableEntry is a pair of strings representing an entry in the table
*/
class TableEntry {
String ext;
String value;
public TableEntry(String ext, String value) {
this.ext = ext;
this.value = value;
}
public String getExtension() {
return ext;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
/**
* TableLabelProvider provides labels for TableEntrys.
*/
class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
public String getColumnText(Object element, int columnIndex) {
TableEntry entry = (TableEntry)element;
switch (columnIndex) {
case 0:
return entry.getExtension();
case 1:
return entry.getValue();
default:
return null;
}
}
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
};
/*
* Method declared on IWorkbenchPreferencePage
*/
public void init(IWorkbench workbench) {
}
/*
* @see PreferencePage#createControl
*/
protected Control createContents(Composite ancestor) {
noDefaultAndApplyButton();
Composite parent = new Composite(ancestor, SWT.NULL);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.numColumns = 2;
parent.setLayout(layout);
// set F1 help
//WorkbenchHelp.setHelp(parent, new DialogPageContextComputer (this, ITeamHelpContextIds.TEXT_PREFERENCE_PAGE));
Label l1 = new Label(parent, SWT.NULL);
l1.setText(Policy.bind("TextPreferencePage.description")); //$NON-NLS-1$
GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 2;
l1.setLayoutData(data);
viewer = new TableViewer(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Table table = viewer.getTable();
new TableEditor(table);
table.setHeaderVisible(true);
table.setLinesVisible(true);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = convertWidthInCharsToPixels(30);
table.setLayoutData(gd);
table.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
handleSelection();
}
});
// Create the table columns
new TableColumn(table, SWT.NULL);
new TableColumn(table, SWT.NULL);
TableColumn[] columns = table.getColumns();
columns[0].setText(Policy.bind("TextPreferencePage.extension")); //$NON-NLS-1$
columns[1].setText(Policy.bind("TextPreferencePage.contents")); //$NON-NLS-1$
CellEditor editor = new ComboBoxCellEditor(table, new String[] {TEXT, BINARY});
viewer.setCellEditors(new CellEditor[] {null, editor});
viewer.setColumnProperties(new String[] {"extension", "contents"}); //$NON-NLS-1$ //$NON-NLS-2$
viewer.setCellModifier(new ICellModifier() {
public Object getValue(Object element, String property) {
String value = ((TableEntry)element).getValue();
if (value.equals(TEXT)) {
return new Integer(0);
} else {
return new Integer(1);
}
}
public boolean canModify(Object element, String property) {
return true;
}
public void modify(Object element, String property, Object value) {
IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
TableEntry entry = (TableEntry)selection.getFirstElement();
if (((Integer)value).intValue() == 0) {
entry.setValue(TEXT);
} else {
entry.setValue(BINARY);
}
viewer.refresh(entry);
}
});
viewer.setLabelProvider(new TableLabelProvider());
viewer.setContentProvider(new IStructuredContentProvider() {
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
public Object[] getElements(Object inputElement) {
if (inputElement == null) return null;
return ((List)inputElement).toArray();
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
viewer.editElement(((IStructuredSelection)selection).getFirstElement(), 1);
}
});
TableLayout tl = new TableLayout();
tl.addColumnData(new ColumnWeightData(50));
tl.addColumnData(new ColumnWeightData(50));
table.setLayout(tl);
Composite buttons = new Composite(parent, SWT.NULL);
buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
buttons.setLayout(new GridLayout());
Button addButton = new Button(buttons, SWT.PUSH);
addButton.setText(Policy.bind("TextPreferencePage.add")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, addButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
addButton.setLayoutData(data);
addButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
addPattern();
}
});
removeButton= new Button(buttons, SWT.PUSH);
removeButton.setText(Policy.bind("TextPreferencePage.remove")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
removeButton.setLayoutData(data);
removeButton.setEnabled(false);
removeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removePattern();
}
});
changeButton = new Button(buttons, SWT.PUSH);
changeButton.setText(Policy.bind("TextPreferencePage.change")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, changeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
changeButton.setLayoutData(data);
changeButton.setEnabled(false);
changeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
changePattern();
}
});
fillTable();
return parent;
}
/**
* Do anything necessary because the OK button has been pressed.
*
* @return whether it is okay to close the preference page
*/
public boolean performOk() {
int size = input.size();
String[] extensions = new String[size];
int[] types = new int[size];
int i = 0;
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
String value = entry.getValue();
if (value.equals(TEXT)) {
types[i] = Team.TEXT;
} else {
types[i] = Team.BINARY;
}
extensions[i] = entry.getExtension();
i++;
}
Team.setAllTypes(extensions, types);
return true;
}
/**
* Fill the table with the values from the file type registry
*/
private void fillTable() {
this.input = new ArrayList();
IFileTypeInfo[] infos = Team.getAllTypes();
for (int i = 0; i < infos.length; i++) {
IFileTypeInfo info = infos[i];
int type = info.getType();
switch (type) {
case Team.TEXT:
input.add(new TableEntry(info.getExtension(), TEXT));
break;
case Team.BINARY:
input.add(new TableEntry(info.getExtension(), BINARY));
break;
}
}
viewer.setInput(input);
}
/**
* Add a new item to the table with the default type of Text.
*/
private void addPattern() {
InputDialog dialog = new InputDialog(getShell(), Policy.bind("TextPreferencePage.enterExtensionShort"), Policy.bind("TextPreferencePage.enterExtensionLong"), null, null); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
String pattern = dialog.getValue();
if (pattern.equals("")) return; //$NON-NLS-1$
// Check if the item already exists
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
if (entry.getExtension().equals(pattern)) {
MessageDialog.openWarning(getShell(), Policy.bind("TextPreferencePage.extensionExistsShort"), Policy.bind("TextPreferencePage.extensionExistsLong")); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
}
input.add(new TableEntry(pattern, TEXT));
viewer.refresh();
}
/**
* Remove the selected items from the table
*/
private void removePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
Iterator it = ss.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
input.remove(entry);
}
viewer.refresh();
}
/**
* Toggle the selected items' content types
*/
private void changePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
Iterator it = ss.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
String string = entry.getValue();
if (string.equals(TEXT)) {
entry.setValue(BINARY);
} else {
entry.setValue(TEXT);
}
viewer.refresh(entry);
}
}
/**
* The table viewer selection has changed. Update the remove and change button enablement.
*/
private void handleSelection() {
boolean empty = viewer.getSelection().isEmpty();
removeButton.setEnabled(!empty);
changeButton.setEnabled(!empty);
}
}
\ No newline at end of file +package org.eclipse.team.internal.ui;
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.core.IFileTypeInfo;
import org.eclipse.team.core.Team;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* This preference page displays all patterns which determine whether a resource
* is to be treated as a text file or not. The page allows the user to add or
* remove entries from this table, and change their values from Text to Binary.
*/
public class TextPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
// Some string constants for display purposes
private static final String TEXT = Policy.bind("TextPreferencePage.text"); //$NON-NLS-1$
private static final String BINARY = Policy.bind("TextPreferencePage.binary"); //$NON-NLS-1$
// The name of the parameter in the file registry
private static final String TYPE = "type"; //$NON-NLS-1$
// The input for the table viewer
private List input;
// Widgets
private TableViewer viewer;
private Button removeButton;
private Button changeButton;
/**
* TableEntry is a pair of strings representing an entry in the table
*/
class TableEntry {
String ext;
String value;
public TableEntry(String ext, String value) {
this.ext = ext;
this.value = value;
}
public String getExtension() {
return ext;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
/**
* TableLabelProvider provides labels for TableEntrys.
*/
class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
public String getColumnText(Object element, int columnIndex) {
TableEntry entry = (TableEntry)element;
switch (columnIndex) {
case 0:
return entry.getExtension();
case 1:
return entry.getValue();
default:
return null;
}
}
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
};
/*
* Method declared on IWorkbenchPreferencePage
*/
public void init(IWorkbench workbench) {
}
/*
* @see PreferencePage#createControl
*/
protected Control createContents(Composite ancestor) {
noDefaultAndApplyButton();
Composite parent = new Composite(ancestor, SWT.NULL);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.numColumns = 2;
parent.setLayout(layout);
// set F1 help
//WorkbenchHelp.setHelp(parent, new DialogPageContextComputer (this, ITeamHelpContextIds.TEXT_PREFERENCE_PAGE));
Label l1 = new Label(parent, SWT.NULL);
l1.setText(Policy.bind("TextPreferencePage.description")); //$NON-NLS-1$
GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 2;
l1.setLayoutData(data);
viewer = new TableViewer(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Table table = viewer.getTable();
new TableEditor(table);
table.setHeaderVisible(true);
table.setLinesVisible(true);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = convertWidthInCharsToPixels(30);
table.setLayoutData(gd);
table.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
handleSelection();
}
});
// Create the table columns
new TableColumn(table, SWT.NULL);
new TableColumn(table, SWT.NULL);
TableColumn[] columns = table.getColumns();
columns[0].setText(Policy.bind("TextPreferencePage.extension")); //$NON-NLS-1$
columns[1].setText(Policy.bind("TextPreferencePage.contents")); //$NON-NLS-1$
CellEditor editor = new ComboBoxCellEditor(table, new String[] {TEXT, BINARY});
viewer.setCellEditors(new CellEditor[] {null, editor});
viewer.setColumnProperties(new String[] {"extension", "contents"}); //$NON-NLS-1$ //$NON-NLS-2$
viewer.setCellModifier(new ICellModifier() {
public Object getValue(Object element, String property) {
String value = ((TableEntry)element).getValue();
if (value.equals(TEXT)) {
return new Integer(0);
} else {
return new Integer(1);
}
}
public boolean canModify(Object element, String property) {
return true;
}
public void modify(Object element, String property, Object value) {
IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
TableEntry entry = (TableEntry)selection.getFirstElement();
if (((Integer)value).intValue() == 0) {
entry.setValue(TEXT);
} else {
entry.setValue(BINARY);
}
viewer.refresh(entry);
}
});
viewer.setLabelProvider(new TableLabelProvider());
viewer.setContentProvider(new IStructuredContentProvider() {
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
public Object[] getElements(Object inputElement) {
if (inputElement == null) return null;
return ((List)inputElement).toArray();
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
viewer.editElement(((IStructuredSelection)selection).getFirstElement(), 1);
}
});
TableLayout tl = new TableLayout();
tl.addColumnData(new ColumnWeightData(50));
tl.addColumnData(new ColumnWeightData(50));
table.setLayout(tl);
Composite buttons = new Composite(parent, SWT.NULL);
buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
buttons.setLayout(new GridLayout());
Button addButton = new Button(buttons, SWT.PUSH);
addButton.setText(Policy.bind("TextPreferencePage.add")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, addButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
addButton.setLayoutData(data);
addButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
addPattern();
}
});
removeButton= new Button(buttons, SWT.PUSH);
removeButton.setText(Policy.bind("TextPreferencePage.remove")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
removeButton.setLayoutData(data);
removeButton.setEnabled(false);
removeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removePattern();
}
});
changeButton = new Button(buttons, SWT.PUSH);
changeButton.setText(Policy.bind("TextPreferencePage.change")); //$NON-NLS-1$
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, changeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
changeButton.setLayoutData(data);
changeButton.setEnabled(false);
changeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
changePattern();
}
});
fillTable();
return parent;
}
/**
* Do anything necessary because the OK button has been pressed.
*
* @return whether it is okay to close the preference page
*/
public boolean performOk() {
int size = input.size();
String[] extensions = new String[size];
int[] types = new int[size];
int i = 0;
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
String value = entry.getValue();
if (value.equals(TEXT)) {
types[i] = Team.TEXT;
} else {
types[i] = Team.BINARY;
}
extensions[i] = entry.getExtension();
i++;
}
Team.setAllTypes(extensions, types);
return true;
}
/**
* Fill the table with the values from the file type registry
*/
private void fillTable() {
this.input = new ArrayList();
IFileTypeInfo[] infos = Team.getAllTypes();
for (int i = 0; i < infos.length; i++) {
IFileTypeInfo info = infos[i];
int type = info.getType();
switch (type) {
case Team.TEXT:
input.add(new TableEntry(info.getExtension(), TEXT));
break;
case Team.BINARY:
input.add(new TableEntry(info.getExtension(), BINARY));
break;
}
}
viewer.setInput(input);
}
/**
* Add a new item to the table with the default type of Text.
*/
private void addPattern() {
InputDialog dialog = new InputDialog(getShell(), Policy.bind("TextPreferencePage.enterExtensionShort"), Policy.bind("TextPreferencePage.enterExtensionLong"), null, null); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
String pattern = dialog.getValue();
if (pattern.equals("")) return; //$NON-NLS-1$
// Check if the item already exists
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
if (entry.getExtension().equals(pattern)) {
MessageDialog.openWarning(getShell(), Policy.bind("TextPreferencePage.extensionExistsShort"), Policy.bind("TextPreferencePage.extensionExistsLong")); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
}
input.add(new TableEntry(pattern, TEXT));
viewer.refresh();
}
/**
* Remove the selected items from the table
*/
private void removePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
Iterator it = ss.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
input.remove(entry);
}
viewer.refresh();
}
/**
* Toggle the selected items' content types
*/
private void changePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
Iterator it = ss.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
String string = entry.getValue();
if (string.equals(TEXT)) {
entry.setValue(BINARY);
} else {
entry.setValue(TEXT);
}
viewer.refresh(entry);
}
}
/**
* The table viewer selection has changed. Update the remove and change button enablement.
*/
private void handleSelection() {
boolean empty = viewer.getSelection().isEmpty();
removeButton.setEnabled(!empty);
changeButton.setEnabled(!empty);
}
}
\ No newline at end of file diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java index 32321013b..c665d4304 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java @@ -29,7 +29,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; -import org.eclipse.team.core.TeamPlugin; +import org.eclipse.team.internal.core.TeamPlugin; import org.eclipse.team.internal.ui.Policy; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.ui.IObjectActionDelegate; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java index 22b006ada..605c04e25 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java @@ -31,8 +31,8 @@ import org.eclipse.jface.util.Assert; import org.eclipse.jface.util.ListenerList; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; -import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.core.sync.IRemoteSyncElement; +import org.eclipse.team.internal.core.TeamPlugin; import org.eclipse.team.internal.ui.Policy; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.ui.internal.WorkbenchPlugin; |