diff options
author | Curtis Windatt | 2009-02-03 15:30:54 +0000 |
---|---|---|
committer | Curtis Windatt | 2009-02-03 15:30:54 +0000 |
commit | af2c8f3062e8176827fc5fc51f98766862049383 (patch) | |
tree | eafa9afed604fe673c74f36cb2dfa7d085e599bd /org.eclipse.debug.ui | |
parent | 3d53888d0f4af1bb49a0d0038ac74dc861567eb8 (diff) | |
download | eclipse.platform.debug-af2c8f3062e8176827fc5fc51f98766862049383.tar.gz eclipse.platform.debug-af2c8f3062e8176827fc5fc51f98766862049383.tar.xz eclipse.platform.debug-af2c8f3062e8176827fc5fc51f98766862049383.zip |
Bug 259442 - [Debug] Add a Copy/Paste context menu in the "Add watch expression" window
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259442
Diffstat (limited to 'org.eclipse.debug.ui')
3 files changed, 609 insertions, 567 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java index e1bcf099a..0549bb18a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java @@ -1,221 +1,224 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.actions; - -import org.eclipse.osgi.util.NLS; - -public class ActionMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.actions.ActionMessages";//$NON-NLS-1$ - - public static String AbstractLaunchHistoryAction_0; - public static String AbstractLaunchHistoryAction_1; - public static String AbstractLaunchHistoryAction_2; - public static String AbstractLaunchHistoryAction_3; - public static String AbstractLaunchHistoryAction_4; - - public static String AbstractLaunchHistoryAction_5; - - public static String AbstractLaunchHistoryAction_6; - - public static String AddToFavoritesAction_1; - public static String AddToFavoritesAction_2; - public static String AddToFavoritesAction_3; - - public static String ChangeVariableValue_errorDialogMessage; - public static String ChangeVariableValue_errorDialogTitle; - public static String ChangeVariableValue_title; - public static String ChangeVariableValue_toolTipText; - public static String ChangeVariableValue_1; - public static String ChangeVariableValue_2; - public static String ChangeVariableValue_3; - public static String ChangeVariableValue_4; - - public static String CollapseAllAction_0; - - public static String ConfigureColumnsAction_0; - public static String ConfigureColumnsAction_1; - public static String ConfigureColumnsAction_2; - - public static String CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1; - public static String CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2; - - public static String DebugLastAction_0; - - public static String DebugLastAction_1; - public static String DebugLastAction_2; - public static String DebugLastAction_3; - - public static String DetailPaneAssignValueAction_0; - public static String DetailPaneAssignValueAction_1; - public static String DetailPaneAssignValueAction_2; - public static String DetailPaneAssignValueAction_3; - public static String DetailPaneAssignValueAction_4; - public static String DetailPaneWordWrapAction_0; - public static String DetailPaneMaxLengthAction_0; - - public static String EditLaunchConfigurationAction_1; - - public static String EnableBreakpointAction_Enable_breakpoint_s__failed_2; - public static String EnableBreakpointAction_Enabling_breakpoints_3; - public static String EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4; - - public static String LaunchConfigurationAction_0; - - public static String OpenBreakpointMarkerAction__Go_to_File_1; - public static String OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2; - public static String OpenBreakpointMarkerAction_Go_to_Breakpoint_1; - public static String OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2; - - public static String OpenLaunchDialogAction_1; - - public static String ProfileLastAction_0; - - public static String ProfileLastAction_1; - public static String ProfileLastAction_2; - public static String ProfileLastAction_3; - - public static String RelaunchActionDelegate_An_exception_occurred_while_launching_2; - public static String RelaunchActionDelegate_Launch_Failed_1; - public static String RelaunchLastAction_Cannot_relaunch_1; - public static String RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2; - public static String RelaunchLastAction_Error_relaunching_3; - public static String RelaunchLastAction_Error_encountered_attempting_to_relaunch_4; - - public static String RemoveAllBreakpointsAction_0; - public static String RemoveAllBreakpointsAction_1; - public static String RemoveAllBreakpointsAction_2; - public static String RemoveAllBreakpointsAction_3; - public static String RemoveBreakpointAction_0; - public static String RemoveBreakpointAction_1; - public static String RemoveBreakpointAction_2; - public static String RemoveBreakpointAction_3; - public static String RemoveBreakpointAction_4; - public static String RemoveBreakpointAction_5; - public static String RemoveBreakpointAction_6; - public static String RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5; - public static String RemoveBreakpointAction_Removing_a_breakpoint_4; - - public static String RetargetRunToLineAction_0; - - public static String RunLastAction_0; - - public static String RunLastAction_1; - public static String RunLastAction_2; - public static String RunLastAction_3; - - public static String ShowSupportedBreakpointsAction_Show_For_Selected; - public static String ShowSupportedBreakpointsAction_tooltip; - - public static String ShowTypesAction_Show__Type_Names_1; - public static String ShowTypesAction_Show_Type_Names; - - public static String SkipAllBreakpointsAction_0; - public static String SkipAllBreakpointsAction_2; - - public static String TerminateAndRelaunchAction_0; - public static String TerminateAndRelaunchAction_3; - public static String TerminateAndRelaunchAction_4; - public static String TerminateAndRemoveAction_0; - public static String TerminateAndRemoveAction_3; - - public static String ToggleDetailPaneAction_1; - public static String ToggleDetailPaneAction_2; - public static String ToggleDetailPaneAction_3; - public static String ToggleDetailPaneAction_4; - public static String ToggleDetailPaneAction_5; - public static String ToggleDetailPaneAction_6; - public static String ToggleDetailPaneAction_8; - public static String ToggleDetailPaneAction_9; - public static String ToggleBreakpointAction_0; - public static String ToggleBreakpointAction_1; - public static String ToggleBreakpointAction_2; - public static String ToggleStepFiltersAction_0; - public static String ToggleStepFiltersAction_1; - - public static String WatchExpressionDialog_0; - public static String WatchExpressionDialog_1; - public static String WatchExpressionDialog_2; - public static String WatchExpressionDialog_3; - public static String WatchExpressionDialog_4; - public static String WatchAction_0; - public static String WatchAction_1; - - public static String RunToLineAction_0; - public static String RunToLineAction_1; - public static String RunToLineHandler_0; - public static String RunToLineActionDelegate_4; - - public static String RetargetAction_2; - public static String RetargetAction_3; - public static String ModifyWatchpointAction_0; - public static String ModifyWatchpointAction_1; - public static String RemoveAllExpressionsAction_0; - public static String RemoveAllExpressionsAction_1; - public static String LaunchShortcutsAction_1; - public static String FindDialog_1; - public static String FindDialog_3; - public static String FindAction_0; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class); - } - - public static String AbstractDebugActionDelegate_0; - - public static String RetargetAddMemoryBlockAction_0; - public static String RetargetAddMemoryBlockAction_1; - public static String AddMemoryRenderingActionDelegate_0; - public static String AddMemoryRenderingActionDelegate_1; - public static String AddMemoryRenderingActionDelegate_2; - - public static String RulerEnableDisableBreakpointAction_0; - public static String RulerEnableDisableBreakpointAction_1; - public static String RulerEnableDisableBreakpointAction_2; - public static String RulerEnableDisableBreakpointAction_3; - - public static String DisconnectAction_0; - public static String DisconnectAction_3; - public static String DropToFrameAction_0; - public static String DropToFrameAction_3; - public static String LaunchAction_0; - - public static String LaunchAction_1; - - public static String LaunchAction_2; - - public static String ResumeAction_0; - public static String ResumeAction_3; - public static String StepIntoAction_0; - public static String StepIntoAction_3; - public static String StepOverAction_0; - public static String StepOverAction_3; - public static String StepReturnAction_2; - public static String StepReturnAction_3; - public static String SuspendAction_0; - public static String SuspendAction_3; - public static String TerminateAction_0; - public static String TerminateAction_3; - public static String TerminateAllAction_2; - public static String TerminateAllAction_3; - - public static String DeleteWorkingsetsMessageDialog_0; - public static String DeleteWorkingsetsMessageDialog_1; - - public static String ShowTypesAction_0; - - public static String VirtualFindAction_0; - - public static String VirtualFindAction_1; - - public static String ToggleBreakpointsTargetManager_defaultToggleTarget_name; - public static String ToggleBreakpointsTargetManager_defaultToggleTarget_description; +/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.actions;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ActionMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.actions.ActionMessages";//$NON-NLS-1$
+
+ public static String AbstractLaunchHistoryAction_0;
+ public static String AbstractLaunchHistoryAction_1;
+ public static String AbstractLaunchHistoryAction_2;
+ public static String AbstractLaunchHistoryAction_3;
+ public static String AbstractLaunchHistoryAction_4;
+
+ public static String AbstractLaunchHistoryAction_5;
+
+ public static String AbstractLaunchHistoryAction_6;
+
+ public static String AddToFavoritesAction_1;
+ public static String AddToFavoritesAction_2;
+ public static String AddToFavoritesAction_3;
+
+ public static String ChangeVariableValue_errorDialogMessage;
+ public static String ChangeVariableValue_errorDialogTitle;
+ public static String ChangeVariableValue_title;
+ public static String ChangeVariableValue_toolTipText;
+ public static String ChangeVariableValue_1;
+ public static String ChangeVariableValue_2;
+ public static String ChangeVariableValue_3;
+ public static String ChangeVariableValue_4;
+
+ public static String CollapseAllAction_0;
+
+ public static String ConfigureColumnsAction_0;
+ public static String ConfigureColumnsAction_1;
+ public static String ConfigureColumnsAction_2;
+
+ public static String CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1;
+ public static String CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2;
+
+ public static String DebugLastAction_0;
+
+ public static String DebugLastAction_1;
+ public static String DebugLastAction_2;
+ public static String DebugLastAction_3;
+
+ public static String DetailPaneAssignValueAction_0;
+ public static String DetailPaneAssignValueAction_1;
+ public static String DetailPaneAssignValueAction_2;
+ public static String DetailPaneAssignValueAction_3;
+ public static String DetailPaneAssignValueAction_4;
+ public static String DetailPaneWordWrapAction_0;
+ public static String DetailPaneMaxLengthAction_0;
+
+ public static String EditLaunchConfigurationAction_1;
+
+ public static String EnableBreakpointAction_Enable_breakpoint_s__failed_2;
+ public static String EnableBreakpointAction_Enabling_breakpoints_3;
+ public static String EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4;
+
+ public static String LaunchConfigurationAction_0;
+
+ public static String OpenBreakpointMarkerAction__Go_to_File_1;
+ public static String OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2;
+ public static String OpenBreakpointMarkerAction_Go_to_Breakpoint_1;
+ public static String OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2;
+
+ public static String OpenLaunchDialogAction_1;
+
+ public static String ProfileLastAction_0;
+
+ public static String ProfileLastAction_1;
+ public static String ProfileLastAction_2;
+ public static String ProfileLastAction_3;
+
+ public static String RelaunchActionDelegate_An_exception_occurred_while_launching_2;
+ public static String RelaunchActionDelegate_Launch_Failed_1;
+ public static String RelaunchLastAction_Cannot_relaunch_1;
+ public static String RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2;
+ public static String RelaunchLastAction_Error_relaunching_3;
+ public static String RelaunchLastAction_Error_encountered_attempting_to_relaunch_4;
+
+ public static String RemoveAllBreakpointsAction_0;
+ public static String RemoveAllBreakpointsAction_1;
+ public static String RemoveAllBreakpointsAction_2;
+ public static String RemoveAllBreakpointsAction_3;
+ public static String RemoveBreakpointAction_0;
+ public static String RemoveBreakpointAction_1;
+ public static String RemoveBreakpointAction_2;
+ public static String RemoveBreakpointAction_3;
+ public static String RemoveBreakpointAction_4;
+ public static String RemoveBreakpointAction_5;
+ public static String RemoveBreakpointAction_6;
+ public static String RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5;
+ public static String RemoveBreakpointAction_Removing_a_breakpoint_4;
+
+ public static String RetargetRunToLineAction_0;
+
+ public static String RunLastAction_0;
+
+ public static String RunLastAction_1;
+ public static String RunLastAction_2;
+ public static String RunLastAction_3;
+
+ public static String ShowSupportedBreakpointsAction_Show_For_Selected;
+ public static String ShowSupportedBreakpointsAction_tooltip;
+
+ public static String ShowTypesAction_Show__Type_Names_1;
+ public static String ShowTypesAction_Show_Type_Names;
+
+ public static String SkipAllBreakpointsAction_0;
+ public static String SkipAllBreakpointsAction_2;
+
+ public static String TerminateAndRelaunchAction_0;
+ public static String TerminateAndRelaunchAction_3;
+ public static String TerminateAndRelaunchAction_4;
+ public static String TerminateAndRemoveAction_0;
+ public static String TerminateAndRemoveAction_3;
+
+ public static String ToggleDetailPaneAction_1;
+ public static String ToggleDetailPaneAction_2;
+ public static String ToggleDetailPaneAction_3;
+ public static String ToggleDetailPaneAction_4;
+ public static String ToggleDetailPaneAction_5;
+ public static String ToggleDetailPaneAction_6;
+ public static String ToggleDetailPaneAction_8;
+ public static String ToggleDetailPaneAction_9;
+ public static String ToggleBreakpointAction_0;
+ public static String ToggleBreakpointAction_1;
+ public static String ToggleBreakpointAction_2;
+ public static String ToggleStepFiltersAction_0;
+ public static String ToggleStepFiltersAction_1;
+
+ public static String WatchExpressionDialog_0;
+ public static String WatchExpressionDialog_1;
+ public static String WatchExpressionDialog_2;
+ public static String WatchExpressionDialog_3;
+ public static String WatchExpressionDialog_4;
+ public static String WatchExpressionDialogMenu_0;
+ public static String WatchExpressionDialogMenu_1;
+ public static String WatchExpressionDialogMenu_2;
+ public static String WatchAction_0;
+ public static String WatchAction_1;
+
+ public static String RunToLineAction_0;
+ public static String RunToLineAction_1;
+ public static String RunToLineHandler_0;
+ public static String RunToLineActionDelegate_4;
+
+ public static String RetargetAction_2;
+ public static String RetargetAction_3;
+ public static String ModifyWatchpointAction_0;
+ public static String ModifyWatchpointAction_1;
+ public static String RemoveAllExpressionsAction_0;
+ public static String RemoveAllExpressionsAction_1;
+ public static String LaunchShortcutsAction_1;
+ public static String FindDialog_1;
+ public static String FindDialog_3;
+ public static String FindAction_0;
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
+ }
+
+ public static String AbstractDebugActionDelegate_0;
+
+ public static String RetargetAddMemoryBlockAction_0;
+ public static String RetargetAddMemoryBlockAction_1;
+ public static String AddMemoryRenderingActionDelegate_0;
+ public static String AddMemoryRenderingActionDelegate_1;
+ public static String AddMemoryRenderingActionDelegate_2;
+
+ public static String RulerEnableDisableBreakpointAction_0;
+ public static String RulerEnableDisableBreakpointAction_1;
+ public static String RulerEnableDisableBreakpointAction_2;
+ public static String RulerEnableDisableBreakpointAction_3;
+
+ public static String DisconnectAction_0;
+ public static String DisconnectAction_3;
+ public static String DropToFrameAction_0;
+ public static String DropToFrameAction_3;
+ public static String LaunchAction_0;
+
+ public static String LaunchAction_1;
+
+ public static String LaunchAction_2;
+
+ public static String ResumeAction_0;
+ public static String ResumeAction_3;
+ public static String StepIntoAction_0;
+ public static String StepIntoAction_3;
+ public static String StepOverAction_0;
+ public static String StepOverAction_3;
+ public static String StepReturnAction_2;
+ public static String StepReturnAction_3;
+ public static String SuspendAction_0;
+ public static String SuspendAction_3;
+ public static String TerminateAction_0;
+ public static String TerminateAction_3;
+ public static String TerminateAllAction_2;
+ public static String TerminateAllAction_3;
+
+ public static String DeleteWorkingsetsMessageDialog_0;
+ public static String DeleteWorkingsetsMessageDialog_1;
+
+ public static String ShowTypesAction_0;
+
+ public static String VirtualFindAction_0;
+
+ public static String VirtualFindAction_1;
+
+ public static String ToggleBreakpointsTargetManager_defaultToggleTarget_name;
+ public static String ToggleBreakpointsTargetManager_defaultToggleTarget_description;
}
\ No newline at end of file diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties index 9bc187757..d7061a7c3 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties @@ -1,206 +1,209 @@ -############################################################################### -# Copyright (c) 2000, 2008 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -AddToFavoritesAction_1=Add to {0} &Favorites -AddToFavoritesAction_2=Error -AddToFavoritesAction_3=Unable to add to favorites. - -ChangeVariableValue_errorDialogMessage=Setting the value failed. -ChangeVariableValue_errorDialogTitle=Setting Value -ChangeVariableValue_title=&Change Value... -ChangeVariableValue_toolTipText=Change the Value of the Selected Variable or Register -ChangeVariableValue_1=Set Value -ChangeVariableValue_2=Enter a new value for {0}: -ChangeVariableValue_3=An exception occurred -ChangeVariableValue_4=Invalid value - - -CollapseAllAction_0=Collapse All - -CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1=Problem Copying to Clipboard -CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2=There was a problem when accessing the system clipboard. Retry? - -EditLaunchConfigurationAction_1=Edit {0}... - -EnableBreakpointAction_Enable_breakpoint_s__failed_2=Enable/Disable breakpoint(s) failed -EnableBreakpointAction_Enabling_breakpoints_3=Enabling/disabling breakpoints -EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4=Exceptions occurred enabling/disabling the breakpoint(s). - -OpenBreakpointMarkerAction__Go_to_File_1=&Go to File -OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2=Exceptions occurred attempting to open the editor for the breakpoint resource -OpenBreakpointMarkerAction_Go_to_Breakpoint_1=Go to File -OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2=Go to File for Breakpoint - -RelaunchActionDelegate_An_exception_occurred_while_launching_2=An exception occurred while launching -RelaunchActionDelegate_Launch_Failed_1=Launch Failed - -RemoveAllBreakpointsAction_0=Remove All Breakpoints -RemoveAllBreakpointsAction_1=Are you sure you want to remove all breakpoints? -RemoveAllBreakpointsAction_2=Remove Breakpoints -RemoveAllBreakpointsAction_3=&Do not ask me again. -RemoveAllExpressionsAction_0=Remove All Expressions -RemoveAllExpressionsAction_1=Are you sure you want to remove all expressions? - -RemoveBreakpointAction_0=Delete Breakpoints -RemoveBreakpointAction_1=Delete all breakpoints in the selected group(s)? -RemoveBreakpointAction_2=Remove Breakpoints -RemoveBreakpointAction_3=Remove Items -RemoveBreakpointAction_4=Which item(s) would you like to remove? -RemoveBreakpointAction_5=OK -RemoveBreakpointAction_6=Cancel -RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5=An exception occurred attempting to remove breakpoint(s). -RemoveBreakpointAction_Removing_a_breakpoint_4=Removing a breakpoint -DeleteWorkingsetsMessageDialog_0=&Selected working set(s). -DeleteWorkingsetsMessageDialog_1=&All breakpoints contained in selected working set(s). - -ShowSupportedBreakpointsAction_Show_For_Selected=Show Supported &Breakpoints -ShowSupportedBreakpointsAction_tooltip=Show Breakpoints Supported by Selected Target - -ShowTypesAction_Show__Type_Names_1=Show &Type Names -ShowTypesAction_Show_Type_Names=Show Type Names -ShowTypesAction_0='Show Type Names' unavailable when columns are displayed.\nConfigure columns to display type names. - -RelaunchLastAction_Cannot_relaunch_1=Cannot relaunch -RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2=Cannot relaunch [{0}] because it does not support {1} mode -RelaunchLastAction_Error_relaunching_3=Error relaunching -RelaunchLastAction_Error_encountered_attempting_to_relaunch_4=Error encountered attempting to relaunch - -## -# @see Bug 105733 TVT 3.1 - TCT 531 - Poor grammar in "Run Eclipse Application" and "Profile Eclipse Application" -# - the following string is used to display the tooltip for run/debug/profile buttons and is -# the concatenation of "{mode} {configuration name}", for example "Run HelloWorld". In some languages -# this may need to be reversed to be translated properly. -## -AbstractLaunchHistoryAction_0={0} {1} -AbstractLaunchHistoryAction_1=Run -AbstractLaunchHistoryAction_2=Debug -AbstractLaunchHistoryAction_3=Profile -AbstractLaunchHistoryAction_4=Launch -## -# The following string is used to display the tooltip for run/debug/profile buttons in the -# event there is no configuration name to concatenate (as mentioned for AbstractLaunchHistoryAction_0) -# For example "Run" or "External Tools". -## -AbstractLaunchHistoryAction_5={0} -AbstractLaunchHistoryAction_6=(no launch history) -AbstractDebugActionDelegate_0=Error - -ToggleDetailPaneAction_1=Vertical View Orientation -ToggleDetailPaneAction_2=Place the Detail Pane Underneath the Main Tree View -ToggleDetailPaneAction_3=Place the Detail Pane Underneath the Main Tree View -ToggleDetailPaneAction_4=Horizontal View Orientation -ToggleDetailPaneAction_5=Place the Detail Pane on the Right of the Main Tree View -ToggleDetailPaneAction_6=Place the Detail Pane on the Right of the Main Tree View -ToggleDetailPaneAction_8=Hide the Detail Pane so that only the Main Tree View is Visible -ToggleDetailPaneAction_9=Hide the Detail Pane so that only the Main Tree View is Visible -ToggleBreakpointAction_0=Toggle Brea&kpoint -ToggleBreakpointAction_1=Error -ToggleBreakpointAction_2=Unable to toggle breakpoint - -ToggleStepFiltersAction_0=Use Step Filters -ToggleStepFiltersAction_1=&Use Step Filters - -WatchExpressionDialog_0=Edit Watch Expression -WatchExpressionDialog_1=Add Watch Expression -WatchExpressionDialog_2=E&xpression: -WatchExpressionDialog_3=&Enable -WatchExpressionDialog_4=Expression must not be empty -WatchAction_0=Error creating watch -WatchAction_1=An exception occurred while attempting to create watch item. -SkipAllBreakpointsAction_0=Skip All Breakpoints -SkipAllBreakpointsAction_2=Skip all breakpoints, whether they are enabled or not -DetailPaneAssignValueAction_1=Assign Value -DetailPaneAssignValueAction_2=Invalid Value -DetailPaneAssignValueAction_3=The value {0} cannot be assigned to {1} -DetailPaneAssignValueAction_4=Invalid Value -DetailPaneAssignValueAction_0=Error Setting Value -DetailPaneWordWrapAction_0=&Wrap Text -DetailPaneMaxLengthAction_0=&Max Length... - -RunToLineAction_0=Error -RunToLineAction_1=Run to line failed -RunToLineHandler_0=Run To Line -RunToLineActionDelegate_4=Run to &Line - -RetargetAction_2=Error -RetargetAction_3=Operation failed -ModifyWatchpointAction_0=Error -ModifyWatchpointAction_1=Failed to modify watchpoint -LaunchShortcutsAction_1=(none applicable) -## -# The following string is used to display launch histories using an integer mnemonic - i.e. -# "{number} {configuration name}". For example "1 HelloWorld". -## -LaunchConfigurationAction_0=&{0} {1} -FindDialog_1=&Specify an element to select (? = any character, * = any String): -FindDialog_3=Find -FindAction_0=&Find... -RetargetAddMemoryBlockAction_0=Add Memory Monitor Failed. -RetargetAddMemoryBlockAction_1=Unable to add memory monitor. -RetargetRunToLineAction_0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to. -AddMemoryRenderingActionDelegate_0=Add Memory Rendering Failed -AddMemoryRenderingActionDelegate_1=Unable to add the selected rendering. -AddMemoryRenderingActionDelegate_2=Add Memory Rendering -RulerEnableDisableBreakpointAction_0=Error -RulerEnableDisableBreakpointAction_1=Failed to toggle breakpoint enablement -RulerEnableDisableBreakpointAction_2=&Disable Breakpoint -RulerEnableDisableBreakpointAction_3=&Enable Breakpoint -TerminateAndRelaunchAction_0=org.eclipse.debug.ui.commands.TerminateAndRelaunch -TerminateAndRelaunchAction_3=Terminate and Relaunch -TerminateAndRelaunchAction_4=Terminate and Relaunch -TerminateAndRemoveAction_0=Terminate and Remo&ve -TerminateAndRemoveAction_3=Terminate and Remove -TerminateAllAction_2=Termi&nate/Disconnect All -TerminateAllAction_3=Terminate/Disconnect All -TerminateAction_0=&Terminate -TerminateAction_3=Terminate -StepReturnAction_2=Step Return -StepReturnAction_3=Step Ret&urn -StepIntoAction_0=Step &Into -StepIntoAction_3=Step Into -StepOverAction_0=Step &Over -StepOverAction_3=Step Over -LaunchAction_0=Remove Configuration -LaunchAction_1=Are you sure you want to remove {0} from the launch history? -LaunchAction_2=&Do not ask me again. -ResumeAction_0=Resu&me -ResumeAction_3=Resume -DisconnectAction_0=Disconn&ect -DisconnectAction_3=Disconnect -DropToFrameAction_0=Drop To Frame -DropToFrameAction_3=Drop To Frame -SuspendAction_0=&Suspend -SuspendAction_3=Suspend -ConfigureColumnsAction_0=Select &Columns... -ConfigureColumnsAction_1=Select the &columns to display: -ConfigureColumnsAction_2=Select Columns -ProfileLastAction_0=Profi&le Last Launched -ProfileLastAction_1=Profi&le -ProfileLastAction_2=Profile the selected resource or active editor -ProfileLastAction_3=Profile the previously launched application -DebugLastAction_0=&Debug Last Launched -DebugLastAction_1=&Debug -DebugLastAction_2=Debug the selected resource or active editor -DebugLastAction_3=Debug the previously launched application -RunLastAction_0=&Run Last Launched -RunLastAction_1=&Run -RunLastAction_2=Run the selected resource or active editor -RunLastAction_3=Run the previously launched application -## -# The following string is used to display actions to open the launch dialog for -# a specific mode - for example "Debug Configurations..." -## -OpenLaunchDialogAction_1={0} Configurations... -VirtualFindAction_0=Error -VirtualFindAction_1=Unable to locate {0} in viewer - -ToggleBreakpointsTargetManager_defaultToggleTarget_name = Default +###############################################################################
+# Copyright (c) 2000, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+AddToFavoritesAction_1=Add to {0} &Favorites
+AddToFavoritesAction_2=Error
+AddToFavoritesAction_3=Unable to add to favorites.
+
+ChangeVariableValue_errorDialogMessage=Setting the value failed.
+ChangeVariableValue_errorDialogTitle=Setting Value
+ChangeVariableValue_title=&Change Value...
+ChangeVariableValue_toolTipText=Change the Value of the Selected Variable or Register
+ChangeVariableValue_1=Set Value
+ChangeVariableValue_2=Enter a new value for {0}:
+ChangeVariableValue_3=An exception occurred
+ChangeVariableValue_4=Invalid value
+
+
+CollapseAllAction_0=Collapse All
+
+CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1=Problem Copying to Clipboard
+CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2=There was a problem when accessing the system clipboard. Retry?
+
+EditLaunchConfigurationAction_1=Edit {0}...
+
+EnableBreakpointAction_Enable_breakpoint_s__failed_2=Enable/Disable breakpoint(s) failed
+EnableBreakpointAction_Enabling_breakpoints_3=Enabling/disabling breakpoints
+EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4=Exceptions occurred enabling/disabling the breakpoint(s).
+
+OpenBreakpointMarkerAction__Go_to_File_1=&Go to File
+OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2=Exceptions occurred attempting to open the editor for the breakpoint resource
+OpenBreakpointMarkerAction_Go_to_Breakpoint_1=Go to File
+OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2=Go to File for Breakpoint
+
+RelaunchActionDelegate_An_exception_occurred_while_launching_2=An exception occurred while launching
+RelaunchActionDelegate_Launch_Failed_1=Launch Failed
+
+RemoveAllBreakpointsAction_0=Remove All Breakpoints
+RemoveAllBreakpointsAction_1=Are you sure you want to remove all breakpoints?
+RemoveAllBreakpointsAction_2=Remove Breakpoints
+RemoveAllBreakpointsAction_3=&Do not ask me again.
+RemoveAllExpressionsAction_0=Remove All Expressions
+RemoveAllExpressionsAction_1=Are you sure you want to remove all expressions?
+
+RemoveBreakpointAction_0=Delete Breakpoints
+RemoveBreakpointAction_1=Delete all breakpoints in the selected group(s)?
+RemoveBreakpointAction_2=Remove Breakpoints
+RemoveBreakpointAction_3=Remove Items
+RemoveBreakpointAction_4=Which item(s) would you like to remove?
+RemoveBreakpointAction_5=OK
+RemoveBreakpointAction_6=Cancel
+RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5=An exception occurred attempting to remove breakpoint(s).
+RemoveBreakpointAction_Removing_a_breakpoint_4=Removing a breakpoint
+DeleteWorkingsetsMessageDialog_0=&Selected working set(s).
+DeleteWorkingsetsMessageDialog_1=&All breakpoints contained in selected working set(s).
+
+ShowSupportedBreakpointsAction_Show_For_Selected=Show Supported &Breakpoints
+ShowSupportedBreakpointsAction_tooltip=Show Breakpoints Supported by Selected Target
+
+ShowTypesAction_Show__Type_Names_1=Show &Type Names
+ShowTypesAction_Show_Type_Names=Show Type Names
+ShowTypesAction_0='Show Type Names' unavailable when columns are displayed.\nConfigure columns to display type names.
+
+RelaunchLastAction_Cannot_relaunch_1=Cannot relaunch
+RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2=Cannot relaunch [{0}] because it does not support {1} mode
+RelaunchLastAction_Error_relaunching_3=Error relaunching
+RelaunchLastAction_Error_encountered_attempting_to_relaunch_4=Error encountered attempting to relaunch
+
+##
+# @see Bug 105733 TVT 3.1 - TCT 531 - Poor grammar in "Run Eclipse Application" and "Profile Eclipse Application"
+# - the following string is used to display the tooltip for run/debug/profile buttons and is
+# the concatenation of "{mode} {configuration name}", for example "Run HelloWorld". In some languages
+# this may need to be reversed to be translated properly.
+##
+AbstractLaunchHistoryAction_0={0} {1}
+AbstractLaunchHistoryAction_1=Run
+AbstractLaunchHistoryAction_2=Debug
+AbstractLaunchHistoryAction_3=Profile
+AbstractLaunchHistoryAction_4=Launch
+##
+# The following string is used to display the tooltip for run/debug/profile buttons in the
+# event there is no configuration name to concatenate (as mentioned for AbstractLaunchHistoryAction_0)
+# For example "Run" or "External Tools".
+##
+AbstractLaunchHistoryAction_5={0}
+AbstractLaunchHistoryAction_6=(no launch history)
+AbstractDebugActionDelegate_0=Error
+
+ToggleDetailPaneAction_1=Vertical View Orientation
+ToggleDetailPaneAction_2=Place the Detail Pane Underneath the Main Tree View
+ToggleDetailPaneAction_3=Place the Detail Pane Underneath the Main Tree View
+ToggleDetailPaneAction_4=Horizontal View Orientation
+ToggleDetailPaneAction_5=Place the Detail Pane on the Right of the Main Tree View
+ToggleDetailPaneAction_6=Place the Detail Pane on the Right of the Main Tree View
+ToggleDetailPaneAction_8=Hide the Detail Pane so that only the Main Tree View is Visible
+ToggleDetailPaneAction_9=Hide the Detail Pane so that only the Main Tree View is Visible
+ToggleBreakpointAction_0=Toggle Brea&kpoint
+ToggleBreakpointAction_1=Error
+ToggleBreakpointAction_2=Unable to toggle breakpoint
+
+ToggleStepFiltersAction_0=Use Step Filters
+ToggleStepFiltersAction_1=&Use Step Filters
+
+WatchExpressionDialog_0=Edit Watch Expression
+WatchExpressionDialog_1=Add Watch Expression
+WatchExpressionDialog_2=E&xpression:
+WatchExpressionDialog_3=&Enable
+WatchExpressionDialog_4=Expression must not be empty
+WatchExpressionDialogMenu_0=Cut
+WatchExpressionDialogMenu_1=Copy
+WatchExpressionDialogMenu_2=Paste
+WatchAction_0=Error creating watch
+WatchAction_1=An exception occurred while attempting to create watch item.
+SkipAllBreakpointsAction_0=Skip All Breakpoints
+SkipAllBreakpointsAction_2=Skip all breakpoints, whether they are enabled or not
+DetailPaneAssignValueAction_1=Assign Value
+DetailPaneAssignValueAction_2=Invalid Value
+DetailPaneAssignValueAction_3=The value {0} cannot be assigned to {1}
+DetailPaneAssignValueAction_4=Invalid Value
+DetailPaneAssignValueAction_0=Error Setting Value
+DetailPaneWordWrapAction_0=&Wrap Text
+DetailPaneMaxLengthAction_0=&Max Length...
+
+RunToLineAction_0=Error
+RunToLineAction_1=Run to line failed
+RunToLineHandler_0=Run To Line
+RunToLineActionDelegate_4=Run to &Line
+
+RetargetAction_2=Error
+RetargetAction_3=Operation failed
+ModifyWatchpointAction_0=Error
+ModifyWatchpointAction_1=Failed to modify watchpoint
+LaunchShortcutsAction_1=(none applicable)
+##
+# The following string is used to display launch histories using an integer mnemonic - i.e.
+# "{number} {configuration name}". For example "1 HelloWorld".
+##
+LaunchConfigurationAction_0=&{0} {1}
+FindDialog_1=&Specify an element to select (? = any character, * = any String):
+FindDialog_3=Find
+FindAction_0=&Find...
+RetargetAddMemoryBlockAction_0=Add Memory Monitor Failed.
+RetargetAddMemoryBlockAction_1=Unable to add memory monitor.
+RetargetRunToLineAction_0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to.
+AddMemoryRenderingActionDelegate_0=Add Memory Rendering Failed
+AddMemoryRenderingActionDelegate_1=Unable to add the selected rendering.
+AddMemoryRenderingActionDelegate_2=Add Memory Rendering
+RulerEnableDisableBreakpointAction_0=Error
+RulerEnableDisableBreakpointAction_1=Failed to toggle breakpoint enablement
+RulerEnableDisableBreakpointAction_2=&Disable Breakpoint
+RulerEnableDisableBreakpointAction_3=&Enable Breakpoint
+TerminateAndRelaunchAction_0=org.eclipse.debug.ui.commands.TerminateAndRelaunch
+TerminateAndRelaunchAction_3=Terminate and Relaunch
+TerminateAndRelaunchAction_4=Terminate and Relaunch
+TerminateAndRemoveAction_0=Terminate and Remo&ve
+TerminateAndRemoveAction_3=Terminate and Remove
+TerminateAllAction_2=Termi&nate/Disconnect All
+TerminateAllAction_3=Terminate/Disconnect All
+TerminateAction_0=&Terminate
+TerminateAction_3=Terminate
+StepReturnAction_2=Step Return
+StepReturnAction_3=Step Ret&urn
+StepIntoAction_0=Step &Into
+StepIntoAction_3=Step Into
+StepOverAction_0=Step &Over
+StepOverAction_3=Step Over
+LaunchAction_0=Remove Configuration
+LaunchAction_1=Are you sure you want to remove {0} from the launch history?
+LaunchAction_2=&Do not ask me again.
+ResumeAction_0=Resu&me
+ResumeAction_3=Resume
+DisconnectAction_0=Disconn&ect
+DisconnectAction_3=Disconnect
+DropToFrameAction_0=Drop To Frame
+DropToFrameAction_3=Drop To Frame
+SuspendAction_0=&Suspend
+SuspendAction_3=Suspend
+ConfigureColumnsAction_0=Select &Columns...
+ConfigureColumnsAction_1=Select the &columns to display:
+ConfigureColumnsAction_2=Select Columns
+ProfileLastAction_0=Profi&le Last Launched
+ProfileLastAction_1=Profi&le
+ProfileLastAction_2=Profile the selected resource or active editor
+ProfileLastAction_3=Profile the previously launched application
+DebugLastAction_0=&Debug Last Launched
+DebugLastAction_1=&Debug
+DebugLastAction_2=Debug the selected resource or active editor
+DebugLastAction_3=Debug the previously launched application
+RunLastAction_0=&Run Last Launched
+RunLastAction_1=&Run
+RunLastAction_2=Run the selected resource or active editor
+RunLastAction_3=Run the previously launched application
+##
+# The following string is used to display actions to open the launch dialog for
+# a specific mode - for example "Debug Configurations..."
+##
+OpenLaunchDialogAction_1={0} Configurations...
+VirtualFindAction_0=Error
+VirtualFindAction_1=Unable to locate {0} in viewer
+
+ToggleBreakpointsTargetManager_defaultToggleTarget_name = Default
ToggleBreakpointsTargetManager_defaultToggleTarget_description = Default
\ No newline at end of file diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java index ebf383cd3..355794634 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java @@ -1,142 +1,178 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.actions.expressions; - - -import org.eclipse.debug.core.model.IWatchExpression; -import org.eclipse.debug.internal.ui.IDebugHelpContextIds; -import org.eclipse.debug.internal.ui.actions.ActionMessages; -import org.eclipse.debug.internal.ui.actions.StatusInfo; -import org.eclipse.jface.dialogs.StatusDialog; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.text.source.SourceViewerConfiguration; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -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.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Dialog for edit watch expression. - */ -public class WatchExpressionDialog extends StatusDialog { - - /** - * The detail formatter to edit. - */ - private IWatchExpression fWatchExpression; - - // widgets - private SourceViewer fSnippetViewer; - private Button fCheckBox; - - public WatchExpressionDialog(Shell parent, IWatchExpression watchExpression, boolean editDialog) { - super(parent); - fWatchExpression= watchExpression; - setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE); - String helpContextId = null; - if (editDialog) { - setTitle(ActionMessages.WatchExpressionDialog_0); - helpContextId = IDebugHelpContextIds.EDIT_WATCH_EXPRESSION_DIALOG; - } else { - setTitle(ActionMessages.WatchExpressionDialog_1); - helpContextId = IDebugHelpContextIds.ADD_WATCH_EXPRESSION_DIALOG; - } - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpContextId); - } - - /** - * Create the dialog area. - * - * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite) - */ - protected Control createDialogArea(Composite parent) { - Font font = parent.getFont(); - - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - GridData gd= new GridData(GridData.FILL_BOTH); - container.setLayoutData(gd); - - // snippet label - Label label = new Label(container, SWT.NONE); - label.setText(ActionMessages.WatchExpressionDialog_2); - gd= new GridData(GridData.BEGINNING); - label.setLayoutData(gd); - label.setFont(font); - - fSnippetViewer = new SourceViewer(container, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT_TO_RIGHT); - fSnippetViewer.setInput(this); - - IDocument document = new Document(); - fSnippetViewer.configure(new SourceViewerConfiguration()); - fSnippetViewer.setEditable(true); - fSnippetViewer.setDocument(document); - document.addDocumentListener(new IDocumentListener() { - public void documentAboutToBeChanged(DocumentEvent event) { - } - public void documentChanged(DocumentEvent event) { - checkValues(); - } - }); - - fSnippetViewer.getTextWidget().setFont(JFaceResources.getTextFont()); - - Control control= fSnippetViewer.getControl(); - gd= new GridData(GridData.FILL_BOTH); - gd.heightHint= convertHeightInCharsToPixels(10); - gd.widthHint= convertWidthInCharsToPixels(80); - control.setLayoutData(gd); - fSnippetViewer.getDocument().set(fWatchExpression.getExpressionText()); - - // enable checkbox - fCheckBox= new Button(container, SWT.CHECK | SWT.LEFT); - fCheckBox.setText(ActionMessages.WatchExpressionDialog_3); - fCheckBox.setSelection(fWatchExpression.isEnabled()); - fCheckBox.setFont(font); - - applyDialogFont(container); - fSnippetViewer.getControl().setFocus(); - return container; - } - - /** - * @see org.eclipse.jface.dialogs.Dialog#okPressed() - */ - protected void okPressed() { - fWatchExpression.setEnabled(fCheckBox.getSelection()); - fWatchExpression.setExpressionText(fSnippetViewer.getDocument().get()); - super.okPressed(); - } - - /** - * Check the field values and display a message in the status if needed. - */ - private void checkValues() { - StatusInfo status= new StatusInfo(); - if (fSnippetViewer.getDocument().get().trim().length() == 0) { - status.setError(ActionMessages.WatchExpressionDialog_4); - } - updateStatus(status); - } - -} +/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.actions.expressions;
+
+
+import org.eclipse.debug.core.model.IWatchExpression;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.actions.StatusInfo;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.StatusDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+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.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.actions.TextViewerAction;
+
+/**
+ * Dialog for edit watch expression.
+ */
+public class WatchExpressionDialog extends StatusDialog {
+
+ /**
+ * The detail formatter to edit.
+ */
+ private IWatchExpression fWatchExpression;
+
+ // widgets
+ private SourceViewer fSnippetViewer;
+ private Button fCheckBox;
+
+ public WatchExpressionDialog(Shell parent, IWatchExpression watchExpression, boolean editDialog) {
+ super(parent);
+ fWatchExpression= watchExpression;
+ setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE);
+ String helpContextId = null;
+ if (editDialog) {
+ setTitle(ActionMessages.WatchExpressionDialog_0);
+ helpContextId = IDebugHelpContextIds.EDIT_WATCH_EXPRESSION_DIALOG;
+ } else {
+ setTitle(ActionMessages.WatchExpressionDialog_1);
+ helpContextId = IDebugHelpContextIds.ADD_WATCH_EXPRESSION_DIALOG;
+ }
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpContextId);
+ }
+
+ /**
+ * Create the dialog area.
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ Font font = parent.getFont();
+
+ Composite container = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ GridData gd= new GridData(GridData.FILL_BOTH);
+ container.setLayoutData(gd);
+
+ // snippet label
+ Label label = new Label(container, SWT.NONE);
+ label.setText(ActionMessages.WatchExpressionDialog_2);
+ gd= new GridData(GridData.BEGINNING);
+ label.setLayoutData(gd);
+ label.setFont(font);
+
+ fSnippetViewer = new SourceViewer(container, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT_TO_RIGHT);
+ fSnippetViewer.setInput(this);
+
+ IDocument document = new Document();
+ fSnippetViewer.configure(new SourceViewerConfiguration());
+ fSnippetViewer.setEditable(true);
+ fSnippetViewer.setDocument(document);
+ document.addDocumentListener(new IDocumentListener() {
+ public void documentAboutToBeChanged(DocumentEvent event) {
+ }
+ public void documentChanged(DocumentEvent event) {
+ checkValues();
+ }
+ });
+
+ fSnippetViewer.getTextWidget().setFont(JFaceResources.getTextFont());
+
+ Control control= fSnippetViewer.getControl();
+ gd= new GridData(GridData.FILL_BOTH);
+ gd.heightHint= convertHeightInCharsToPixels(10);
+ gd.widthHint= convertWidthInCharsToPixels(80);
+ control.setLayoutData(gd);
+ fSnippetViewer.getDocument().set(fWatchExpression.getExpressionText());
+
+ // actions
+ final TextViewerAction cutAction = new TextViewerAction(fSnippetViewer, ITextOperationTarget.CUT);
+ cutAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
+ cutAction.setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
+ cutAction.setText(ActionMessages.WatchExpressionDialogMenu_0);
+ final TextViewerAction copyAction = new TextViewerAction(fSnippetViewer, ITextOperationTarget.COPY);
+ copyAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
+ copyAction.setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
+ copyAction.setText(ActionMessages.WatchExpressionDialogMenu_1);
+ final TextViewerAction pasteAction = new TextViewerAction(fSnippetViewer, ITextOperationTarget.PASTE);
+ pasteAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
+ pasteAction.setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
+ pasteAction.setText(ActionMessages.WatchExpressionDialogMenu_2);
+
+ // context menu
+ MenuManager menuManager = new MenuManager();
+ menuManager.add(cutAction);
+ menuManager.add(copyAction);
+ menuManager.add(pasteAction);
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ cutAction.update();
+ copyAction.update();
+ pasteAction.update();
+ }
+ });
+ Menu menu = menuManager.createContextMenu(fSnippetViewer.getTextWidget());
+ fSnippetViewer.getTextWidget().setMenu(menu);
+
+ // enable checkbox
+ fCheckBox= new Button(container, SWT.CHECK | SWT.LEFT);
+ fCheckBox.setText(ActionMessages.WatchExpressionDialog_3);
+ fCheckBox.setSelection(fWatchExpression.isEnabled());
+ fCheckBox.setFont(font);
+
+ applyDialogFont(container);
+ fSnippetViewer.getControl().setFocus();
+ return container;
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ fWatchExpression.setEnabled(fCheckBox.getSelection());
+ fWatchExpression.setExpressionText(fSnippetViewer.getDocument().get());
+ super.okPressed();
+ }
+
+ /**
+ * Check the field values and display a message in the status if needed.
+ */
+ private void checkValues() {
+ StatusInfo status= new StatusInfo();
+ if (fSnippetViewer.getDocument().get().trim().length() == 0) {
+ status.setError(ActionMessages.WatchExpressionDialog_4);
+ }
+ updateStatus(status);
+ }
+
+}
|