Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-05-31 21:46:25 +0000
committerMichael Valenta2002-05-31 21:46:25 +0000
commit824c599758c5fe2764d3c17ba91bf2176207507a (patch)
tree0de569e693e77b50331b093e462e8532430e73e2 /bundles
parent20fbe86fb90e941ee158a1942917e3fead0293ce (diff)
downloadeclipse.platform.team-824c599758c5fe2764d3c17ba91bf2176207507a.tar.gz
eclipse.platform.team-824c599758c5fe2764d3c17ba91bf2176207507a.tar.xz
eclipse.platform.team-824c599758c5fe2764d3c17ba91bf2176207507a.zip
Added F1 help
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/help_contexts.xml21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MoveRemoteTagAction.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateMergeAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceCommitSyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceUpdateSyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/UpdateSyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardDirtyFilesPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSelectionPage.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSharedFilesPage.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSummaryPage.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardFinishPage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ExportProjectSetMainPage.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ImportProjectSetMainPage.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamPreferencePage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java2
35 files changed, 251 insertions, 39 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/help_contexts.xml b/bundles/org.eclipse.team.cvs.ui/help_contexts.xml
index 05a70ece7..24e134c5f 100644
--- a/bundles/org.eclipse.team.cvs.ui/help_contexts.xml
+++ b/bundles/org.eclipse.team.cvs.ui/help_contexts.xml
@@ -131,7 +131,7 @@
</context>
<!-- ********************************** -->
- <!-- Actions -->
+ <!-- Actions -->
<!-- ********************************** -->
<context id="get_file_revision_action_context" >
@@ -142,4 +142,23 @@
<description>Load the contents of the file into the workspace. The base revision of the local file will not change and the file will become dirty. Perform this action if you wich to revert to the contents of an older revision of the file.
</description>
</context>
+
+ <!-- ********************************** -->
+ <!-- Team Actions -->
+ <!-- ********************************** -->
+
+ <context id="team_commit_action_context" >
+ <description>Commit outgoing changes to the respository
+ </description>
+ </context>
+
+ <!-- ********************************** -->
+ <!-- Sync Actions -->
+ <!-- ********************************** -->
+
+ <context id="sync_commit_action_context" >
+ <description>Commit outgoing changes to the respository
+ </description>
+ </context>
+
</contexts>
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 2f6f2873c..8d9efcde3 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -218,6 +218,7 @@
tooltip="%CommitAction.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"
menubarPath="team.main/group1"
+ helpContextId="org.eclipse.team.cvs.ui.team_commit_action_context"
id="org.eclipse.team.ccvs.ui.commit">
</action>
<action
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
index 56a6604cc..b14475b70 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
@@ -21,27 +21,27 @@ public interface IHelpContextIds {
public static final String RELEASE_COMMENT_DIALOG = PREFIX + "release_comment_dialog_context"; //$NON-NLS-1$
public static final String BRANCH_DIALOG = PREFIX + "branch_dialog_context"; //$NON-NLS-1$
- // Different uses of the TagSelectionDialog (not done)
+ // Different uses of the TagSelectionDialog (not done in xml)
public static final String REPLACE_TAG_SELECTION_DIALOG = PREFIX + "replace_tag_selection_dialog_context"; //$NON-NLS-1$
public static final String COMPARE_TAG_SELECTION_DIALOG = PREFIX + "compare_tag_selection_dialog_context"; //$NON-NLS-1$
- public static final String TAG_REMOTE_WITH_EXISTING_DIALOG = PREFIX + "tag_remot_with_existing_dialog_context"; //$NON-NLS-1$
+ public static final String TAG_REMOTE_WITH_EXISTING_DIALOG = PREFIX + "tag_remote_with_existing_dialog_context"; //$NON-NLS-1$
+ public static final String SHARE_WITH_EXISTING_TAG_SELETION_DIALOG = PREFIX + "share_with_existing_tag_selection_dialog_context"; //$NON-NLS-1$
- // Different uses of the TagAsVersionDialog (not done)
- public static final String TAG_LOCAL_AS_VERSION_DIALOG = PREFIX + "tag_local_as_version_dialog_context"; //$NON-NLS-1$
- public static final String TAG_REMOTE_AS_VERSION_DIALOG = PREFIX + "tag_remote_as_version_dialog_context"; //$NON-NLS-1$
+ // Different uses of the TagAsVersionDialog (not done in xml)
+ public static final String TAG_AS_VERSION_DIALOG = PREFIX + "tag_as_version_dialog_context"; //$NON-NLS-1$
// Different uses of InputDialog from actions (not done)
public static final String DEFINE_BRANCH_DIALOG = PREFIX + "define_branch_dialog_context"; //$NON-NLS-1$
public static final String DEFINE_VERSION_DIALOG = PREFIX + "define_version_dialog_context"; //$NON-NLS-1$
- // Wizards
+ // Wizards (no one seems to add wizard help, only wizard page help)
// (not done)
public static final String SHARING_WIZARD = PREFIX + "sharing_wizard_context"; //$NON-NLS-1$
public static final String KEYWORD_SUBSTITUTION_WIZARD = PREFIX + "keyword_substituton_wizard_context"; //$NON-NLS-1$
public static final String NEW_LOCATION_WIZARD = PREFIX + "new_location_wizard_context"; //$NON-NLS-1$
public static final String PATCH_WIZARD = PREFIX + "patch_wizard_context"; //$NON-NLS-1$
- // Wizard Pages (not done)
+ // Wizard Pages (not done in xml)
public static final String SHARING_AUTOCONNECT_PAGE = PREFIX + "sharing_autoconnect_page_context"; //$NON-NLS-1$
public static final String SHARING_SELECT_REPOSITORY_PAGE = PREFIX + "sharing_select_repository_page_context"; //$NON-NLS-1$
public static final String SHARING_NEW_REPOSITORY_PAGE = PREFIX + "sharing_new_repository_page_context"; //$NON-NLS-1$
@@ -80,4 +80,28 @@ public interface IHelpContextIds {
public static final String GET_FILE_REVISION_ACTION = PREFIX + "get_file_revision_action_context"; //$NON-NLS-1$
public static final String GET_FILE_CONTENTS_ACTION = PREFIX + "get_file_contents_action_context"; //$NON-NLS-1$
+ // Team menu actions (not done: I think these are pure xml)
+ public static final String TEAM_SYNCHRONIZE_ACTION = PREFIX + "team_synchronize_action_context"; //$NON-NLS-1$
+ public static final String TEAM_SYNCHRONIZE_OUTGOING_ACTION = PREFIX + "team_synchronize_outgoing_action_context"; //$NON-NLS-1$
+ public static final String TEAM_COMMIT_ACTION = PREFIX + "team_commit_action_context"; //$NON-NLS-1$
+ public static final String TEAM_UPDATE_ACTION = PREFIX + "team_update_action_context"; //$NON-NLS-1$
+ public static final String TEAM_CREATE_PATCH_ACTION = PREFIX + "team_create_patch_action_context"; //$NON-NLS-1$
+ public static final String TEAM_TAG_AS_VERSION_ACTION = PREFIX + "team_tag_as_version_action_context"; //$NON-NLS-1$
+ public static final String TEAM_BRANCH_ACTION = PREFIX + "team_branch_action_context"; //$NON-NLS-1$
+ public static final String TEAM_MERGE_ACTION = PREFIX + "team_merge_action_context"; //$NON-NLS-1$
+ public static final String TEAM_SET_KEYWORD_MODE_ACTION = PREFIX + "team_set_keyword_mode_action_context"; //$NON-NLS-1$
+ public static final String TEAM_DISCONNECT_ACTION = PREFIX + "team_disconnect_action_context"; //$NON-NLS-1$
+ public static final String TEAM_ADD_ACTION = PREFIX + "team_add_action_context"; //$NON-NLS-1$
+ public static final String TEAM_IGNORE_ACTION = PREFIX + "team_ignore_action_context"; //$NON-NLS-1$
+
+ // Sync view menu actions (not done)
+ public static final String SYNC_COMMIT_ACTION = PREFIX + "sync_commit_action_context"; //$NON-NLS-1$
+ public static final String SYNC_FORCED_COMMIT_ACTION = PREFIX + "sync_forced_commit_action_context"; //$NON-NLS-1$
+ public static final String SYNC_UPDATE_ACTION = PREFIX + "sync_update_action_context"; //$NON-NLS-1$
+ public static final String SYNC_FORCED_UPDATE_ACTION = PREFIX + "sync_forced_update_action_context"; //$NON-NLS-1$
+ public static final String SYNC_ADD_ACTION = PREFIX + "sync_add_action_context"; //$NON-NLS-1$
+ public static final String SYNC_IGNORE_ACTION = PREFIX + "sync_ignore_action_context"; //$NON-NLS-1$
+ public static final String MERGE_UPDATE_ACTION = PREFIX + "merge_update_action_context"; //$NON-NLS-1$
+ public static final String MERGE_FORCED_UPDATE_ACTION = PREFIX + "merge_forced update_action_context"; //$NON-NLS-1$
+ public static final String MERGE_UPDATE_WITH_JOIN_ACTION = PREFIX + "merge_update_with_joinaction_context"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java
index 1dbadb7bb..980419e5b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagAsVersionDialog.java
@@ -85,6 +85,8 @@ public class TagAsVersionDialog extends DetailsDialog {
}
}
);
+ // Add F1 help
+ WorkbenchHelp.setHelp(parent, IHelpContextIds.TAG_AS_VERSION_DIALOG);
}
protected TableViewer createTable(Composite parent) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
index ba8964760..c640fb2e3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
@@ -15,7 +15,6 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -32,6 +31,7 @@ import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.merge.ProjectElement;
import org.eclipse.team.internal.ccvs.ui.merge.TagElement;
import org.eclipse.team.internal.ccvs.ui.merge.ProjectElement.ProjectElementSorter;
+import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -42,6 +42,7 @@ public class TagSelectionDialog extends Dialog {
private ICVSFolder[] folders;
private int includeFlags;
private CVSTag result;
+ private String helpContext;
public static final int INCLUDE_HEAD_TAG = ProjectElement.INCLUDE_HEAD_TAG;
public static final int INCLUDE_BASE_TAG = ProjectElement.INCLUDE_BASE_TAG;
@@ -69,8 +70,8 @@ public class TagSelectionDialog extends Dialog {
* Creates a new TagSelectionDialog.
* @param resource The resource to select a version for.
*/
- public TagSelectionDialog(Shell parentShell, IProject[] projects, String title, String message, int includeFlags, boolean showRecurse) {
- this(parentShell, getCVSFoldersFor(projects), title, message, includeFlags, showRecurse); //$NON-NLS-1$
+ public TagSelectionDialog(Shell parentShell, IProject[] projects, String title, String message, int includeFlags, boolean showRecurse, String helpContext) {
+ this(parentShell, getCVSFoldersFor(projects), title, message, includeFlags, showRecurse, helpContext); //$NON-NLS-1$
}
private static ICVSFolder[] getCVSFoldersFor(IProject[] projects) {
@@ -85,13 +86,14 @@ public class TagSelectionDialog extends Dialog {
* Creates a new TagSelectionDialog.
* @param resource The resource to select a version for.
*/
- public TagSelectionDialog(Shell parentShell, ICVSFolder[] folders, String title, String message, int includeFlags, boolean showRecurse) {
+ public TagSelectionDialog(Shell parentShell, ICVSFolder[] folders, String title, String message, int includeFlags, boolean showRecurse, String helpContext) {
super(parentShell);
this.folders = folders;
this.title = title;
this.message = message;
this.includeFlags = includeFlags;
this.showRecurse = showRecurse;
+ this.helpContext = helpContext;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@@ -147,7 +149,10 @@ public class TagSelectionDialog extends Dialog {
*/
protected Control createDialogArea(Composite parent) {
Composite top = (Composite)super.createDialogArea(parent);
-
+ // Add F1 help
+ if (helpContext != null) {
+ WorkbenchHelp.setHelp(top, helpContext);
+ }
Composite inner = new Composite(top, SWT.NULL);
GridData data = new GridData(GridData.FILL_BOTH);
data.widthHint = SIZING_DIALOG_WIDTH;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
index 880b407b8..4419c73af 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
@@ -15,6 +15,7 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.ui.CVSLocalCompareEditorInput;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
@@ -29,8 +30,12 @@ public class CompareWithTagAction extends CVSAction {
for (int i = 0; i < resources.length; i++) {
projects[i] = resources[i].getProject();
}
- TagSelectionDialog dialog = new TagSelectionDialog(getShell(), projects, Policy.bind("CompareWithTagAction.message"), //$NON-NLS-1$
- Policy.bind("TagSelectionDialog.Select_a_Tag_1"), TagSelectionDialog.INCLUDE_ALL_TAGS, false); //$NON-NLS-1$ //$NON-NLS-2$
+ TagSelectionDialog dialog = new TagSelectionDialog(getShell(), projects,
+ Policy.bind("CompareWithTagAction.message"), //$NON-NLS-1$
+ Policy.bind("TagSelectionDialog.Select_a_Tag_1"), //$NON-NLS-1$
+ TagSelectionDialog.INCLUDE_ALL_TAGS,
+ false, /* show recurse*/
+ IHelpContextIds.COMPARE_TAG_SELECTION_DIALOG);
dialog.setBlockOnOpen(true);
int result = dialog.open();
if (result == Dialog.CANCEL || dialog.getResult() == null) {
@@ -41,8 +46,6 @@ public class CompareWithTagAction extends CVSAction {
CompareUI.openCompareEditor(new CVSLocalCompareEditorInput(resources, tag));
}
-
-
protected boolean isEnabled() {
try {
return isSelectionNonOverlapping();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MoveRemoteTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MoveRemoteTagAction.java
index 990851d80..92329b7d5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MoveRemoteTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MoveRemoteTagAction.java
@@ -33,6 +33,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.RTag;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ui.actions.TeamAction;
@@ -61,7 +62,10 @@ public class MoveRemoteTagAction extends TagInRepositoryAction {
// Allow the user to select a tag
TagSelectionDialog dialog = new TagSelectionDialog(getShell(), folders,
Policy.bind("MoveTagAction.title"), //$NON-NLS-1$
- Policy.bind("MoveTagAction.message"), TagSelectionDialog.INCLUDE_BRANCHES | TagSelectionDialog.INCLUDE_VERSIONS, true); //$NON-NLS-1$
+ Policy.bind("MoveTagAction.message"), //$NON-NLS-1$
+ TagSelectionDialog.INCLUDE_BRANCHES | TagSelectionDialog.INCLUDE_VERSIONS,
+ true, /* show recurse */
+ IHelpContextIds.TAG_REMOTE_WITH_EXISTING_DIALOG);
dialog.setBlockOnOpen(true);
if (dialog.open() == Dialog.CANCEL) {
return null;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java
index 0a2c38117..906d51bde 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithTagAction.java
@@ -28,6 +28,7 @@ import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ui.PromptingDialog;
@@ -64,8 +65,12 @@ public class ReplaceWithTagAction extends CVSAction {
for (int i = 0; i < resources.length; i++) {
projects[i] = resources[i].getProject();
}
- TagSelectionDialog dialog = new TagSelectionDialog(getShell(), projects, Policy.bind("ReplaceWithTagAction.message"), Policy.bind("TagSelectionDialog.Select_a_Tag_1"), //$NON-NLS-1$ //$NON-NLS-2$
- TagSelectionDialog.INCLUDE_ALL_TAGS, true /*show recurse*/); //$NON-NLS-1$
+ TagSelectionDialog dialog = new TagSelectionDialog(getShell(), projects,
+ Policy.bind("ReplaceWithTagAction.message"), //$NON-NLS-1$
+ Policy.bind("TagSelectionDialog.Select_a_Tag_1"), //$NON-NLS-1$
+ TagSelectionDialog.INCLUDE_ALL_TAGS,
+ true, /*show recurse*/
+ IHelpContextIds.REPLACE_TAG_SELECTION_DIALOG); //$NON-NLS-1$
dialog.setBlockOnOpen(true);
if (dialog.open() == Dialog.CANCEL) {
return;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java
index 151e7625f..2f0a2ce91 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/OverrideUpdateMergeAction.java
@@ -8,6 +8,7 @@ package org.eclipse.team.internal.ccvs.ui.merge;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
@@ -28,4 +29,11 @@ public class OverrideUpdateMergeAction extends UpdateMergeAction {
SyncSet set = new SyncSet(new StructuredSelection(node));
return (set.hasConflicts() && hasRealChanges(node, new int[] { ITeamNode.CONFLICTING }));
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.MERGE_FORCED_UPDATE_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateMergeAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateMergeAction.java
index 7cb8ea1ec..a73e3dd76 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateMergeAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateMergeAction.java
@@ -24,6 +24,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
@@ -150,4 +151,11 @@ public class UpdateMergeAction extends UpdateSyncAction {
throw new CVSException(Policy.bind("UpdateMergeActionProblems_merging_remote_resources_into_workspace_2"), e); //$NON-NLS-1$
}
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.MERGE_UPDATE_ACTION;
+ }
+
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java
index 6dcbb2d66..fb075ffef 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/UpdateWithForcedJoinAction.java
@@ -11,6 +11,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.util.Assert;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
import org.eclipse.team.internal.ui.sync.ITeamNode;
@@ -79,4 +80,11 @@ public class UpdateWithForcedJoinAction extends UpdateMergeAction {
set.removeOutgoingNodes();
set.removeIncomingNodes();
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.MERGE_UPDATE_WITH_JOIN_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java
index 98b68ed9b..574a1887e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java
@@ -43,6 +43,7 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.RepositoryManager;
import org.eclipse.team.internal.ui.sync.ChangedTeamContainer;
@@ -149,4 +150,11 @@ public class AddSyncAction extends MergeAction {
set.removeConflictingNodes();
((CVSSyncSet)set).removeAddedChanges();
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.SYNC_ADD_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java
index fe29c1ad9..a352b89a5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
@@ -43,4 +44,11 @@ public class CommitSyncAction extends ForceCommitSyncAction {
set.removeIncomingNodes();
((CVSSyncSet)set).removeNonAddedChanges();
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.SYNC_COMMIT_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceCommitSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceCommitSyncAction.java
index 25ed3adba..0f75ae6b8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceCommitSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceCommitSyncAction.java
@@ -37,6 +37,7 @@ import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.RepositoryManager;
import org.eclipse.team.internal.ui.sync.ChangedTeamContainer;
@@ -315,4 +316,11 @@ public class ForceCommitSyncAction extends MergeAction {
}
return CVSWorkspaceRoot.getRemoteResourceFor(syncElement.getLocal()).exists(monitor);
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.SYNC_FORCED_COMMIT_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceUpdateSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceUpdateSyncAction.java
index 957eabae8..83cfa68bf 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceUpdateSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ForceUpdateSyncAction.java
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.sync;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
import org.eclipse.team.internal.ui.sync.SyncView;
@@ -42,4 +43,11 @@ public class ForceUpdateSyncAction extends UpdateSyncAction {
protected boolean promptForConflicts() {
return true;
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.SYNC_FORCED_UPDATE_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
index 132b76e03..ce086ab9f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
@@ -21,6 +21,7 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.IgnoreResourcesDialog;
import org.eclipse.team.internal.ui.sync.ChangedTeamContainer;
import org.eclipse.team.internal.ui.sync.ITeamNode;
@@ -28,6 +29,7 @@ import org.eclipse.team.internal.ui.sync.MergeResource;
import org.eclipse.team.internal.ui.sync.SyncSet;
import org.eclipse.team.internal.ui.sync.TeamFile;
import org.eclipse.team.internal.ui.sync.UnchangedTeamContainer;
+import org.eclipse.ui.help.WorkbenchHelp;
public class IgnoreAction extends Action {
Shell shell;
@@ -39,6 +41,7 @@ public class IgnoreAction extends Action {
this.shell = shell;
this.diffModel = model;
this.selectionProvider = sp;
+ WorkbenchHelp.setHelp(this, IHelpContextIds.SYNC_IGNORE_ACTION);
}
public void run() {
IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java
index 8864367b5..b0ee0ba5e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/MergeAction.java
@@ -38,6 +38,7 @@ import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
import org.eclipse.team.internal.ui.sync.UnchangedTeamContainer;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.help.WorkbenchHelp;
/**
* Applies merge related actions to the selected ITeamNodes.
@@ -62,6 +63,18 @@ abstract class MergeAction extends Action {
this.diffModel = model;
this.selectionProvider = sp;
this.shell = shell;
+ String helpContextId = getHelpContextID();
+ if (helpContextId != null) {
+ WorkbenchHelp.setHelp(this, helpContextId);
+ }
+ }
+
+ /**
+ * Method getHelpContextID.
+ * @return String
+ */
+ protected String getHelpContextID() {
+ return null;
}
protected Shell getShell() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/UpdateSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/UpdateSyncAction.java
index 2bb5b0c57..338bcc8a2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/UpdateSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/UpdateSyncAction.java
@@ -45,6 +45,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.RepositoryManager;
import org.eclipse.team.internal.ui.sync.ChangedTeamContainer;
@@ -396,4 +397,11 @@ public class UpdateSyncAction extends MergeAction {
set.removeConflictingNodes();
set.removeOutgoingNodes();
}
+ /**
+ * @see MergeAction#getHelpContextID()
+ */
+ protected String getHelpContextID() {
+ return IHelpContextIds.SYNC_UPDATE_ACTION;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java
index f1dbd9e96..7e4507d80 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java
@@ -24,7 +24,9 @@ import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.help.WorkbenchHelp;
/**
* This configuration page explains to the user that CVS/ directories already exists and
@@ -48,6 +50,9 @@ public class ConfigurationWizardAutoconnectPage extends CVSWizardPage {
Composite composite = createComposite(parent, 2);
setControl(composite);
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.SHARING_AUTOCONNECT_PAGE);
+
Label description = new Label(composite, SWT.WRAP);
GridData data = new GridData();
data.horizontalSpan = 2;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
index 09d3d40fe..b54b1f8b1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
@@ -28,7 +28,9 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.help.WorkbenchHelp;
/**
* Wizard page for entering information about a CVS repository location.
@@ -130,7 +132,7 @@ public class ConfigurationWizardMainPage extends CVSWizardPage {
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 2);
// set F1 help
- // WorkbenchHelp.setHelp(composite, new DialogPageContextComputer (this, ITeamHelpContextIds.REPO_CONNECTION_MAIN_PAGE));
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.SHARING_NEW_REPOSITORY_PAGE);
Listener listener = new Listener() {
public void handleEvent(Event event) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
index a7992ed4b..73cb7e197 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java
@@ -50,8 +50,10 @@ import org.eclipse.team.internal.ccvs.core.client.Diff;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.internal.misc.ContainerContentProvider;
import org.eclipse.ui.internal.misc.ResourceAndContainerGroup;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -170,7 +172,10 @@ public class GenerateDiffFileWizard extends Wizard {
composite.setLayout(layout);
composite.setLayoutData(new GridData());
setControl(composite);
-
+
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.PATCH_SELECTION_PAGE);
+
// Clipboard
saveToClipboard= new Button(composite, SWT.RADIO);
saveToClipboard.setText(Policy.bind("Save_To_Clipboard_2")); //$NON-NLS-1$
@@ -384,7 +389,10 @@ public class GenerateDiffFileWizard extends Wizard {
composite.setLayout(layout);
composite.setLayoutData(new GridData());
setControl(composite);
-
+
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.PATCH_OPTIONS_PAGE);
+
recurseOption = new Button(composite, SWT.CHECK);
recurseOption.setText(Policy.bind("Do_not_recurse_into_sub-folders_10")); //$NON-NLS-1$
recurseOption.setSelection(true);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardDirtyFilesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardDirtyFilesPage.java
index 15452e3bf..63d859b1b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardDirtyFilesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardDirtyFilesPage.java
@@ -17,8 +17,10 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.wizards.KSubstWizard.KSubstChangeElement;
+import org.eclipse.ui.help.WorkbenchHelp;
/**
* Page to warn user about uncommitted outgoing changes.
@@ -37,6 +39,10 @@ public class KSubstWizardDirtyFilesPage extends CVSWizardPage {
Composite top = new Composite(parent, SWT.NONE);
top.setLayout(new GridLayout());
setControl(top);
+
+ // set F1 help
+ WorkbenchHelp.setHelp(top, IHelpContextIds.KEYWORD_SUBSTITUTION_CHANGED_PAGE);
+
createWrappingLabel(top, Policy.bind("KSubstWizardDirtyFilesPage.contents"), 0, LABEL_WIDTH_HINT); //$NON-NLS-1$
includeDirtyFilesButton = new Button(top, SWT.CHECK);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSelectionPage.java
index 3707688e8..616af2ba8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSelectionPage.java
@@ -22,7 +22,9 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.help.WorkbenchHelp;
/**
* Page to select keyword substitution mode.
@@ -64,6 +66,9 @@ public class KSubstWizardSelectionPage extends CVSWizardPage {
top.setLayout(new GridLayout());
setControl(top);
+ // set F1 help
+ WorkbenchHelp.setHelp(top, IHelpContextIds.KEYWORD_SUBSTITUTION_SELECTION_PAGE);
+
Listener selectionListener = new Listener() {
public void handleEvent(Event event) {
updateEnablements();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSharedFilesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSharedFilesPage.java
index 435f73975..48e2084c3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSharedFilesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSharedFilesPage.java
@@ -17,8 +17,10 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.wizards.KSubstWizard.KSubstChangeElement;
+import org.eclipse.ui.help.WorkbenchHelp;
/**
* Page to warn user about the side-effects of changing keyword
@@ -39,7 +41,10 @@ public class KSubstWizardSharedFilesPage extends CVSWizardPage {
top.setLayout(new GridLayout());
setControl(top);
createWrappingLabel(top, Policy.bind("KSubstWizardSharedFilesPage.contents"), 0, LABEL_WIDTH_HINT); //$NON-NLS-1$
-
+
+ // set F1 help
+ WorkbenchHelp.setHelp(top, IHelpContextIds.KEYWORD_SUBSTITUTION_SHARED_PAGE);
+
includeSharedFilesButton = new Button(top, SWT.CHECK);
includeSharedFilesButton.setText(Policy.bind("KSubstWizardSharedFilesPage.includeSharedFiles")); //$NON-NLS-1$
includeSharedFilesButton.setSelection(includeSharedFiles);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSummaryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSummaryPage.java
index 42f2964c2..4ff3b410f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSummaryPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardSummaryPage.java
@@ -38,8 +38,10 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.wizards.KSubstWizard.KSubstChangeElement;
+import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.WorkbenchViewerSorter;
public class KSubstWizardSummaryPage extends CVSWizardPage {
@@ -76,6 +78,9 @@ public class KSubstWizardSummaryPage extends CVSWizardPage {
setControl(top);
createWrappingLabel(top, Policy.bind("KSubstWizardSummaryPage.contents"), 0, LABEL_WIDTH_HINT); //$NON-NLS-1$
+ // set F1 help
+ WorkbenchHelp.setHelp(top, IHelpContextIds.KEYWORD_SUBSTITUTION_SUMMARY_PAGE);
+
createSeparator(top, 0);
showUnaffectedFilesButton = new Button(top, SWT.CHECK);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java
index 20b756fd4..e38fea970 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ModuleSelectionPage.java
@@ -13,7 +13,9 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.help.WorkbenchHelp;
public class ModuleSelectionPage extends CVSWizardPage {
Button useProjectNameButton;
@@ -30,7 +32,7 @@ public class ModuleSelectionPage extends CVSWizardPage {
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 2);
// set F1 help
- // WorkbenchHelp.setHelp(composite, new DialogPageContextComputer (this, ITeamHelpContextIds.REPO_CONNECTION_MAIN_PAGE));
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.SHARING_MODULE_PAGE);
useProjectNameButton = createRadioButton(composite, Policy.bind("ModuleSelectionPage.moduleIsProject"), 2); //$NON-NLS-1$
useSpecifiedNameButton = createRadioButton(composite, Policy.bind("ModuleSelectionPage.specifyModule"), 1); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java
index ec2db3509..eebe659bb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/RepositorySelectionPage.java
@@ -26,7 +26,9 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.internal.model.AdaptableList;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -72,7 +74,7 @@ public class RepositorySelectionPage extends CVSWizardPage {
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 2);
// set F1 help
- // WorkbenchHelp.setHelp(composite, new DialogPageContextComputer (this, ITeamHelpContextIds.REPO_CONNECTION_MAIN_PAGE));
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.SHARING_SELECT_REPOSITORY_PAGE);
Label description = new Label(composite, SWT.WRAP);
GridData data = new GridData();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 2ea61710d..9d791ebeb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -38,10 +38,12 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
@@ -209,8 +211,7 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
} else {
// Import
doSync[0] = true;
- // Make sure the directory does not already exist on the server.
- // If it does, return false.
+ // Check if the directory exists on the server
ICVSRepositoryLocation location;
boolean isKnown;
try {
@@ -264,14 +265,16 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
CVSSyncCompareInput input;
if (projectExists[0]) {
try {
- ICVSRepositoryLocation location = getLocation();
String moduleName = getModuleName();
CVSTag tag;
if (autoconnectPage == null) {
TagSelectionDialog dialog = new TagSelectionDialog(getShell(),
- new ICVSFolder[] {(ICVSFolder)location.getRemoteFolder(moduleName, null)},
+ new ICVSFolder[] {(ICVSFolder)getLocation().getRemoteFolder(moduleName, null)},
Policy.bind("SharingWizard.selectTagTitle"), //$NON-NLS-1$
- Policy.bind("SharingWizard.selectTag"), TagSelectionDialog.INCLUDE_HEAD_TAG | TagSelectionDialog.INCLUDE_BRANCHES, false /*don't show recurse option*/); //$NON-NLS-1$
+ Policy.bind("SharingWizard.selectTag"), //$NON-NLS-1$
+ TagSelectionDialog.INCLUDE_HEAD_TAG | TagSelectionDialog.INCLUDE_BRANCHES,
+ false, /*don't show recurse option*/
+ IHelpContextIds.SHARE_WITH_EXISTING_TAG_SELETION_DIALOG);
dialog.setBlockOnOpen(true);
if (dialog.open() == Dialog.CANCEL) {
return false;
@@ -328,7 +331,8 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
}
});
Properties properties = createLocationPage.getProperties();
- return CVSProviderPlugin.getProvider().createRepository(properties);
+ CVSRepositoryLocation location = CVSRepositoryLocation.fromProperties(properties);
+ return CVSProviderPlugin.getProvider().getRepository(location.getLocation());
}
/**
* Return the module name.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardFinishPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardFinishPage.java
index db68d29cd..2797b3772 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardFinishPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardFinishPage.java
@@ -10,7 +10,9 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.help.WorkbenchHelp;
public class SharingWizardFinishPage extends CVSWizardPage {
public SharingWizardFinishPage(String pageName, String title, ImageDescriptor titleImage) {
@@ -22,6 +24,8 @@ public class SharingWizardFinishPage extends CVSWizardPage {
*/
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 1);
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.SHARING_FINISH_PAGE);
Label label = new Label(composite, SWT.LEFT | SWT.WRAP);
label.setText(Policy.bind("SharingWizardFinishPage.message")); //$NON-NLS-1$
GridData data = new GridData();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java
index 5ead7e122..b015af343 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java
@@ -25,6 +25,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.team.ui.IConfigurationWizard;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.internal.model.AdaptableList;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -76,7 +77,10 @@ public class ConfigureProjectWizardMainPage extends WizardPage {
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
setControl(composite);
-
+
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.SHARE_PROJECT_PAGE);
+
Label label = new Label(composite, SWT.LEFT);
label.setText(Policy.bind("ConfigureProjectWizardMainPage.selectRepository")); //$NON-NLS-1$
GridData data = new GridData();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ExportProjectSetMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ExportProjectSetMainPage.java
index c4387ef31..d83e0007f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ExportProjectSetMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ExportProjectSetMainPage.java
@@ -24,18 +24,17 @@ import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
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.Event;
import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.team.core.RepositoryProvider;
+import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -65,7 +64,10 @@ public class ExportProjectSetMainPage extends TeamWizardPage {
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 1);
initializeDialogUnits(composite);
-
+
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.EXPORT_PROJECT_SET_PAGE);
+
createLabel(composite, Policy.bind("ExportProjectSetMainPage.Select_the_projects_to_include_in_the_project_set__2")); //$NON-NLS-1$
table = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java
index 06f30c620..56baf0fbb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IHelpContextIds.java
@@ -14,5 +14,13 @@ public interface IHelpContextIds {
public static final String PREFIX = TeamUIPlugin.ID + "."; //$NON-NLS-1$
// Preference Pages
+ public static final String TEAM_PREFERENCE_PAGE = PREFIX + "team_preference_page_context"; //$NON-NLS-1$
public static final String IGNORE_PREFERENCE_PAGE = PREFIX + "ignore_preference_page_context"; //$NON-NLS-1$
+ public static final String FILE_TYPE_PREFERENCE_PAGE = PREFIX + "file_type_preference_page_context"; //$NON-NLS-1$
+
+ // Wizard Pages
+ public static final String SHARE_PROJECT_PAGE = PREFIX + "share_project_page_context"; //$NON-NLS-1$
+ public static final String IMPORT_PROJECT_SET_PAGE = PREFIX + "import_project_set_page_context"; //$NON-NLS-1$
+ public static final String EXPORT_PROJECT_SET_PAGE = PREFIX + "export_project_set_page_context"; //$NON-NLS-1$
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ImportProjectSetMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ImportProjectSetMainPage.java
index 3a7d29b9e..c9c509cf5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ImportProjectSetMainPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ImportProjectSetMainPage.java
@@ -21,9 +21,9 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.help.WorkbenchHelp;
public class ImportProjectSetMainPage extends TeamWizardPage {
Text fileText;
@@ -40,7 +40,10 @@ public class ImportProjectSetMainPage extends TeamWizardPage {
public void createControl(Composite parent) {
Composite composite = createComposite(parent, 1);
initializeDialogUnits(composite);
-
+
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.IMPORT_PROJECT_SET_PAGE);
+
Composite inner = new Composite(composite, SWT.NULL);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamPreferencePage.java
index 722c19d4c..63a4382ce 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamPreferencePage.java
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.help.WorkbenchHelp;
public class TeamPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
Button syncModeButton;
@@ -34,6 +35,9 @@ public class TeamPreferencePage extends PreferencePage implements IWorkbenchPref
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
+ // set F1 help
+ WorkbenchHelp.setHelp(composite, IHelpContextIds.TEAM_PREFERENCE_PAGE);
+
// GridLayout
GridLayout layout = new GridLayout();
layout.numColumns = 1;
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 6fae19157..2ca63db5d 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.jface.viewers.ViewerSorter; 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); } }); viewer.setSorter(new ViewerSorter() { public int compare(Viewer viewer, Object e1, Object e2) { TableEntry entry1 = (TableEntry)e1; TableEntry entry2 = (TableEntry)e2; return super.compare(viewer, entry1.getExtension(), entry2.getExtension()); } }); 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)); layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; buttons.setLayout(layout); 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.jface.viewers.ViewerSorter; 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; import org.eclipse.ui.help.WorkbenchHelp; /** * 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, IHelpContextIds.FILE_TYPE_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); } }); viewer.setSorter(new ViewerSorter() { public int compare(Viewer viewer, Object e1, Object e2) { TableEntry entry1 = (TableEntry)e1; TableEntry entry2 = (TableEntry)e2; return super.compare(viewer, entry1.getExtension(), entry2.getExtension()); } }); 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)); layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; buttons.setLayout(layout); 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

Back to the top