From 3c98cacf7adb15428d5ef56e1d5a98eed084c186 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 24 Aug 2004 20:48:27 +0000 Subject: [PATCH] Moved the property pages and related classes into the newly created package - "org.eclipse.cdt.debug.internal.ui.propertypages". --- debug/org.eclipse.cdt.debug.ui/ChangeLog | 8 ++++ debug/org.eclipse.cdt.debug.ui/plugin.xml | 2 +- .../ui/actions/ActionMessages.properties | 20 --------- .../CBreakpointPreferenceStore.java | 2 +- .../CBreakpointPropertyPage.java | 42 +++++++++---------- .../propertypages/PropertyPageMessages.java | 33 +++++++++++++++ .../PropertyPageMessages.properties | 31 ++++++++++++++ 7 files changed, 95 insertions(+), 43 deletions(-) rename debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/{actions => propertypages}/CBreakpointPreferenceStore.java (99%) rename debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/{actions => propertypages}/CBreakpointPropertyPage.java (82%) create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.java create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.properties diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 915c32f1b2d..f06542eabc4 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,11 @@ +2004-08-24 Mikhail Khodjaiants + Moved the property pages and related classes into the newly created package - "org.eclipse.cdt.debug.internal.ui.propertypages". + * PropertyPageMessages.properties: new + * CBreakpointPreferenceStore.java + * CBreakpointPropertyPage.java + * PropertyPageMessages.java: new + * ActionMessages.properties + 2004-08-24 Mikhail Khodjaiants Replaced the "Breakpoint Properties" dialog by standard property pages. * CBreakpointPreferenceStore.java diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index f9e7277b6d7..f5f696a70ba 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -1074,7 +1074,7 @@ diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties index 192ab756b91..c2696c9e4f6 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties @@ -106,26 +106,6 @@ MemoryFormatAction.2=Signed Decimal MemoryFormatAction.3=Unsigned Decimal MemoryNumberOfColumnAction.0={0, number, integer} {0, choice, 0\#columns|1\#column|2\#columns} MemoryNumberOfColumnAction.1=Unable to change the column number. -CBreakpointPropertyPage.0=Ignore count must be a nonnegative integer -CBreakpointPropertyPage.1=Not available -CBreakpointPropertyPage.2=Function name: -CBreakpointPropertyPage.3=C/C++ function breakpoint -CBreakpointPropertyPage.4=Not available -CBreakpointPropertyPage.5=Address: -CBreakpointPropertyPage.6=C/C++ address breakpoint -CBreakpointPropertyPage.7=File: -CBreakpointPropertyPage.8=C/C++ line breakpoint -CBreakpointPropertyPage.9=Line number: -CBreakpointPropertyPage.10=Project: -CBreakpointPropertyPage.11=C/C++ read watchpoint -CBreakpointPropertyPage.12=C/C++ watchpoint -CBreakpointPropertyPage.13=C/C++ access watchpoint -CBreakpointPropertyPage.14=Expression to watch: -CBreakpointPropertyPage.15=&Condition: -CBreakpointPropertyPage.16=Invalid condition. -CBreakpointPropertyPage.17=&Ignore count: -CBreakpointPropertyPage.18=Type: -CBreakpointPropertyPage.19=Enabled AddWatchpointActionDelegate.0=Cannot add watchpoint. AddWatchpointDialog.0=Add Watchpoint AddWatchpointDialog.1=Expression to watch: diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPreferenceStore.java similarity index 99% rename from debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java rename to debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPreferenceStore.java index 1e959bd29d7..986ee92e630 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPreferenceStore.java @@ -8,7 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ -package org.eclipse.cdt.debug.internal.ui.actions; +package org.eclipse.cdt.debug.internal.ui.propertypages; import java.util.HashMap; import org.eclipse.jface.preference.IPreferenceStore; diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java similarity index 82% rename from debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertyPage.java rename to debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java index a4ec7901ca9..8e0441bb461 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertyPage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java @@ -8,7 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation ***********************************************************************/ -package org.eclipse.cdt.debug.internal.ui.actions; +package org.eclipse.cdt.debug.internal.ui.propertypages; import java.util.ArrayList; import java.util.Iterator; @@ -51,7 +51,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement public BreakpointIntegerFieldEditor( String name, String labelText, Composite parent ) { super( name, labelText, parent ); - setErrorMessage( ActionMessages.getString( "CBreakpointPropertyPage.0" ) ); //$NON-NLS-1$ + setErrorMessage( PropertyPageMessages.getString( "CBreakpointPropertyPage.0" ) ); //$NON-NLS-1$ } /** @@ -276,8 +276,8 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement private void createTypeSpecificLabelFieldEditors( ICBreakpoint breakpoint ) { if ( breakpoint instanceof ICFunctionBreakpoint ) { ICFunctionBreakpoint fbrkpt = (ICFunctionBreakpoint)breakpoint; - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.18" ), ActionMessages.getString( "CBreakpointPropertyPage.3" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ - String function = ActionMessages.getString( "CBreakpointPropertyPage.1" ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.3" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ + String function = PropertyPageMessages.getString( "CBreakpointPropertyPage.1" ); //$NON-NLS-1$ try { function = fbrkpt.getFunction(); } @@ -286,13 +286,13 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement catch( NumberFormatException e ) { } if ( function != null ) { - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.2" ), function ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.2" ), function ) ); //$NON-NLS-1$ } } else if ( breakpoint instanceof ICAddressBreakpoint ) { ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint; - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.18" ), ActionMessages.getString( "CBreakpointPropertyPage.6" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ - String address = ActionMessages.getString( "CBreakpointPropertyPage.4" ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.6" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ + String address = PropertyPageMessages.getString( "CBreakpointPropertyPage.4" ); //$NON-NLS-1$ try { address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) ); } @@ -301,14 +301,14 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement catch( NumberFormatException e ) { } if ( address != null ) { - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.5" ), address ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.5" ), address ) ); //$NON-NLS-1$ } } else if ( breakpoint instanceof ILineBreakpoint ) { - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.18" ), ActionMessages.getString( "CBreakpointPropertyPage.8" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.8" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ String fileName = breakpoint.getMarker().getResource().getLocation().toOSString(); if ( fileName != null ) { - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.7" ), fileName ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.7" ), fileName ) ); //$NON-NLS-1$ } ILineBreakpoint lBreakpoint = (ILineBreakpoint)breakpoint; StringBuffer lineNumber = new StringBuffer( 4 ); @@ -322,7 +322,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement CDebugUIPlugin.log( ce ); } if ( lineNumber.length() > 0 ) { - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.9" ), lineNumber.toString() ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.9" ), lineNumber.toString() ) ); //$NON-NLS-1$ } } else if ( breakpoint instanceof ICWatchpoint ) { @@ -331,39 +331,39 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement String expression = ""; //$NON-NLS-1$ try { if ( watchpoint.isReadType() && !watchpoint.isWriteType() ) - type = ActionMessages.getString( "CBreakpointPropertyPage.11" ); //$NON-NLS-1$ + type = PropertyPageMessages.getString( "CBreakpointPropertyPage.11" ); //$NON-NLS-1$ else if ( !watchpoint.isReadType() && watchpoint.isWriteType() ) - type = ActionMessages.getString( "CBreakpointPropertyPage.12" ); //$NON-NLS-1$ + type = PropertyPageMessages.getString( "CBreakpointPropertyPage.12" ); //$NON-NLS-1$ else - type = ActionMessages.getString( "CBreakpointPropertyPage.13" ); //$NON-NLS-1$ + type = PropertyPageMessages.getString( "CBreakpointPropertyPage.13" ); //$NON-NLS-1$ expression = watchpoint.getExpression(); } catch( CoreException ce ) { CDebugUIPlugin.log( ce ); } - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.18" ), type ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), type ) ); //$NON-NLS-1$ String projectName = breakpoint.getMarker().getResource().getLocation().toOSString(); if ( projectName != null ) { - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.10" ), projectName ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.10" ), projectName ) ); //$NON-NLS-1$ } - addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPropertyPage.14" ), expression ) ); //$NON-NLS-1$ + addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.14" ), expression ) ); //$NON-NLS-1$ } } protected void createEnabledField( Composite parent ) { - fEnabled = new BooleanFieldEditor( CBreakpointPreferenceStore.ENABLED, ActionMessages.getString( "CBreakpointPropertyPage.19" ), parent ); //$NON-NLS-1$ + fEnabled = new BooleanFieldEditor( CBreakpointPreferenceStore.ENABLED, PropertyPageMessages.getString( "CBreakpointPropertyPage.19" ), parent ); //$NON-NLS-1$ addField( fEnabled ); } protected void createConditionEditor( Composite parent ) { - fCondition = new BreakpointStringFieldEditor( CBreakpointPreferenceStore.CONDITION, ActionMessages.getString( "CBreakpointPropertyPage.15" ), parent ); //$NON-NLS-1$ + fCondition = new BreakpointStringFieldEditor( CBreakpointPreferenceStore.CONDITION, PropertyPageMessages.getString( "CBreakpointPropertyPage.15" ), parent ); //$NON-NLS-1$ fCondition.setEmptyStringAllowed( true ); - fCondition.setErrorMessage( ActionMessages.getString( "CBreakpointPropertyPage.16" ) ); //$NON-NLS-1$ + fCondition.setErrorMessage( PropertyPageMessages.getString( "CBreakpointPropertyPage.16" ) ); //$NON-NLS-1$ addField( fCondition ); } protected void createIgnoreCountEditor( Composite parent ) { - fIgnoreCount = new BreakpointIntegerFieldEditor( CBreakpointPreferenceStore.IGNORE_COUNT, ActionMessages.getString( "CBreakpointPropertyPage.17" ), parent ); //$NON-NLS-1$ + fIgnoreCount = new BreakpointIntegerFieldEditor( CBreakpointPreferenceStore.IGNORE_COUNT, PropertyPageMessages.getString( "CBreakpointPropertyPage.17" ), parent ); //$NON-NLS-1$ fIgnoreCount.setValidRange( 0, Integer.MAX_VALUE ); fIgnoreCountTextControl = fIgnoreCount.getTextControl( parent ); try { diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.java new file mode 100644 index 00000000000..51cabc90a62 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.java @@ -0,0 +1,33 @@ +/********************************************************************** + * Copyright (c) 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + ***********************************************************************/ +package org.eclipse.cdt.debug.internal.ui.propertypages; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class PropertyPageMessages { + + private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.ui.propertypages.PropertyPageMessages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); + + private PropertyPageMessages() { + } + + public static String getString( String key ) { + try { + return RESOURCE_BUNDLE.getString( key ); + } + catch( MissingResourceException e ) { + return '!' + key + '!'; + } + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.properties new file mode 100644 index 00000000000..71bd9661d58 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/PropertyPageMessages.properties @@ -0,0 +1,31 @@ +############################################################################### +# Copyright (c) 2003, 2004 QNX Software Systems and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Common Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/cpl-v10.html +# +# Contributors: +# QNX Software Systems - initial API and implementation +############################################################################### + +CBreakpointPropertyPage.0=Ignore count must be a nonnegative integer +CBreakpointPropertyPage.1=Not available +CBreakpointPropertyPage.2=Function name: +CBreakpointPropertyPage.3=C/C++ function breakpoint +CBreakpointPropertyPage.4=Not available +CBreakpointPropertyPage.5=Address: +CBreakpointPropertyPage.6=C/C++ address breakpoint +CBreakpointPropertyPage.7=File: +CBreakpointPropertyPage.8=C/C++ line breakpoint +CBreakpointPropertyPage.9=Line number: +CBreakpointPropertyPage.10=Project: +CBreakpointPropertyPage.11=C/C++ read watchpoint +CBreakpointPropertyPage.12=C/C++ watchpoint +CBreakpointPropertyPage.13=C/C++ access watchpoint +CBreakpointPropertyPage.14=Expression to watch: +CBreakpointPropertyPage.15=&Condition: +CBreakpointPropertyPage.16=Invalid condition. +CBreakpointPropertyPage.17=&Ignore count: +CBreakpointPropertyPage.18=Type: +CBreakpointPropertyPage.19=Enabled