From 13c9743ab84c7b5d36940bf8c66d7b32ec13ab43 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Wed, 16 Jun 2004 22:27:20 +0000 Subject: [PATCH] Deleted the "C/C++ Debugger Appearance" theme. Moved the diassembly color preferences to the "C/C++ Debug" preference page. --- debug/org.eclipse.cdt.debug.ui/ChangeLog | 9 + debug/org.eclipse.cdt.debug.ui/plugin.xml | 13 - .../ui/IInternalCDebugUIConstants.java | 5 + .../ui/preferences/CDebugPreferencePage.java | 281 +++++++++--------- .../ui/preferences/PreferenceMessages.java | 30 ++ .../preferences/PreferenceMessages.properties | 1 + .../ui/views/disassembly/DisassemblyView.java | 7 +- 7 files changed, 183 insertions(+), 163 deletions(-) create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.java create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index ed80be361b5..fc6a32f4c14 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,12 @@ +2004-06-16 Mikhail Khodjaiants + Deleted the "C/C++ Debugger Appearance" theme. + Moved the diassembly color preferences to the "C/C++ Debug" preference page. + * plugin.xml + * IInternalCDebugUIConstants.java + * CDebugPreferencePage.java + * PreferenceMessages.properties: new + * PreferenceMessages.java: new + 2004-06-16 Mikhail Khodjaiants Moved the disassembly font definition to the platform "Debug" theme. * plugin.xml diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index cdf1f0bfd21..2e8c21f3000 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -1246,19 +1246,6 @@ - - - - - %DisassemblySourceLineColor.description - - = 0 && index < fFormatIds.length ) ? fFormatIds[index] : fFormatIds[0]; + + private static int getFormatId( int index ) { + return (index >= 0 && index < fFormatIds.length) ? fFormatIds[index] : fFormatIds[0]; } - private static int getFormatIndex( int id ) - { - for ( int i = 0; i < fFormatIds.length; ++i ) + private static int getFormatIndex( int id ) { + for( int i = 0; i < fFormatIds.length; ++i ) if ( fFormatIds[i] == id ) return i; return -1; } - protected IntegerFieldEditor getMaxNumberOfInstructionsText() - { + protected IntegerFieldEditor getMaxNumberOfInstructionsText() { return fMaxNumberOfInstructionsText; } -} + + private ColorFieldEditor getDisassemblySourceColor() { + return fDisassemblySourceColor; + } +} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.java new file mode 100644 index 00000000000..5ca9c6daa15 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.java @@ -0,0 +1,30 @@ +/*************************************************************************************************************************************************************** + * 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.preferences; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class PreferenceMessages { + + private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.ui.preferences.PreferenceMessages";//$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); + + private PreferenceMessages() { + } + + public static String getString( String key ) { + // TODO Auto-generated method stub + try { + return RESOURCE_BUNDLE.getString( key ); + } + catch( MissingResourceException e ) { + return '!' + key + '!'; + } + } +} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties new file mode 100644 index 00000000000..08e3c4be16b --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties @@ -0,0 +1 @@ +CDebugPreferencePage.Color_of_disassembly_source_lines_1=Color of source lines: diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyView.java index c5c36a52ad1..5736323649f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyView.java @@ -282,7 +282,7 @@ public class DisassemblyView extends AbstractDebugEventHandlerView getSourceViewerDecorationSupport( viewer ); EditorsPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); - + CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); getSite().setSelectionProvider( viewer.getSelectionProvider() ); setEventHandler( createEventHandler() ); @@ -353,7 +353,7 @@ public class DisassemblyView extends AbstractDebugEventHandlerView getSourceViewer().changeTextPresentation( createTextPresentation( ((DisassemblyEditorInput)input).getSourceRegions() ), true ); } else if ( IInternalCDebugUIConstants.DISASSEMBLY_FONT.equals( propertyName ) ) { - getSourceViewer().getTextWidget().setFont(JFaceResources.getFont( IInternalCDebugUIConstants.DISASSEMBLY_FONT ) ); + getSourceViewer().getTextWidget().setFont( JFaceResources.getFont( IInternalCDebugUIConstants.DISASSEMBLY_FONT ) ); } } @@ -472,6 +472,7 @@ public class DisassemblyView extends AbstractDebugEventHandlerView JFaceResources.getFontRegistry().removeListener( this ); JFaceResources.getColorRegistry().removeListener( this ); EditorsPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this ); + CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this ); if ( fSourceViewerDecorationSupport != null ) { fSourceViewerDecorationSupport.dispose(); @@ -899,7 +900,7 @@ public class DisassemblyView extends AbstractDebugEventHandlerView for ( int i = 0; i < regions.length; ++i ) { p.addStyleRange( new StyleRange( regions[i].getOffset(), regions[i].getLength(), - JFaceResources.getColorRegistry().get( IInternalCDebugUIConstants.DISASSEMBLY_SOURCE_LINE_COLOR ), + CDebugUIPlugin.getPreferenceColor( IInternalCDebugUIConstants.DISASSEMBLY_SOURCE_LINE_COLOR ), null ) ); } return p;