org.eclipse.xtext.ui.editor.syntaxcoloring
Class SyntaxColoringPreferencePage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.eclipse.jface.preference.FieldEditorPreferencePage
              extended by org.eclipse.xtext.ui.editor.preferences.AbstractPreferencePage
                  extended by org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage
All Implemented Interfaces:
java.util.Comparator<Triple<java.lang.String,java.lang.String,TextStyle>>, java.util.EventListener, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.jface.util.IPropertyChangeListener, org.eclipse.ui.IWorkbenchPreferencePage, org.eclipse.ui.IWorkbenchPropertyPage, IHighlightingConfigurationAcceptor

public class SyntaxColoringPreferencePage
extends AbstractPreferencePage
implements IHighlightingConfigurationAcceptor, java.util.Comparator<Triple<java.lang.String,java.lang.String,TextStyle>>

Author:
Dennis Hübner - Initial contribution and API, Sebastian Zarnekow

Field Summary
 
Fields inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
FLAT, GRID, MARGIN_HEIGHT, MARGIN_WIDTH, VERTICAL_SPACING
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
SyntaxColoringPreferencePage()
           
 
Method Summary
 void acceptDefaultHighlighting(java.lang.String id, java.lang.String name, TextStyle style)
          Call this method to announce a specific default style.
protected  void addField(org.eclipse.jface.preference.FieldEditor editor)
          TODO: better use unqualified names in preference store.
 void collectHighlightings(IHighlightingConfiguration configuration)
           
 int compare(Triple<java.lang.String,java.lang.String,TextStyle> left, Triple<java.lang.String,java.lang.String,TextStyle> right)
           
protected  void createFieldEditors()
           
protected  java.lang.String qualifiedName()
           
protected  void refreshAttributes()
           
 
Methods inherited from class org.eclipse.xtext.ui.editor.preferences.AbstractPreferencePage
createContents, createControl, doGetPreferenceStore, getElement, getLanguageName, getQualifier, getWorkbench, init, isPropertyPage, performOk, setElement, updateFieldEditors
 
Methods inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
adjustGridLayout, applyFont, checkState, dispose, getFieldEditorParent, initialize, performDefaults, propertyChange, setVisible
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Constructor Detail

SyntaxColoringPreferencePage

public SyntaxColoringPreferencePage()
Method Detail

qualifiedName

protected java.lang.String qualifiedName()
Overrides:
qualifiedName in class AbstractPreferencePage
Returns:
prefix for preference keys

collectHighlightings

@Inject
public void collectHighlightings(IHighlightingConfiguration configuration)

acceptDefaultHighlighting

public void acceptDefaultHighlighting(java.lang.String id,
                                      java.lang.String name,
                                      TextStyle style)
Description copied from interface: IHighlightingConfigurationAcceptor
Call this method to announce a specific default style. Implementors may throw an IllegalStateException when an id is used twice.

Specified by:
acceptDefaultHighlighting in interface IHighlightingConfigurationAcceptor
Parameters:
id - the unique id that should be associated with the given style.
name - the human readable name of the style.
style - the default style with the given id and name.
See Also:
IHighlightingConfiguration.configure(IHighlightingConfigurationAcceptor)

createFieldEditors

protected void createFieldEditors()
Specified by:
createFieldEditors in class org.eclipse.jface.preference.FieldEditorPreferencePage

refreshAttributes

protected void refreshAttributes()

compare

public int compare(Triple<java.lang.String,java.lang.String,TextStyle> left,
                   Triple<java.lang.String,java.lang.String,TextStyle> right)
Specified by:
compare in interface java.util.Comparator<Triple<java.lang.String,java.lang.String,TextStyle>>

addField

protected void addField(org.eclipse.jface.preference.FieldEditor editor)
TODO: better use unqualified names in preference store. Left this workaround not to break API.

Overrides:
addField in class AbstractPreferencePage