org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance
Class ColorsAndFontsPropertySection
java.lang.Object
org.eclipse.ui.views.properties.tabbed.AbstractPropertySection
org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection
org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractNotationPropertiesSection
org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection
-
All Implemented Interfaces:
-
ISection
-
Direct Known Subclasses:
-
ColoursAndFontsAndLineStylesPropertySection
-
public class ColorsAndFontsPropertySection
- extends
AbstractNotationPropertiesSection
Colors section to represent line and font properties of a shape or connection
Method Summary
|
protected
RGB
|
changeColor
(
SelectionEvent event,
Button button,
java.lang.String propertyId,
java.lang.String commandName,
ImageDescriptor imageDescriptor)
|
protected
RGB
|
changeColor
(
SelectionEvent event,
Button button,
java.lang.String preferenceId,
java.lang.String propertyId,
java.lang.String commandName,
ImageDescriptor imageDescriptor)
Deprecated. The preference is not being retrieved from the correct
preference store so it is not needed, use the other
changeColor method.
|
protected void
|
changeFontColor
(
SelectionEvent event)
Apply font color change |
protected void
|
changeLineColor
(
SelectionEvent event)
Apply line color change |
protected
Group
|
createFontsAndColorsGroups
(
Composite parent)
Create fonts and colors group |
protected
Composite
|
createFontsGroup
(
Composite parent)
Create font tool bar group |
protected boolean
|
digIntoGroups
()
Override to return true to have this property section work on the shapes
in a GroupEditPart as if the shapes were multi-selected. |
void
|
dispose
()
|
protected void
|
disposeImage
(
Image image)
Dispose the image if it was created locally to avoid a leak. |
protected java.util.Iterator
|
getInputIterator
()
|
protected void
|
initializeControls
(
Composite parent)
Provides a level of indirection for subclasses which want 'jump' over
some control creation/initilialization steps and/or chnage thier order |
void
|
refresh
()
|
void
|
setInput
(
IWorkbenchPart part,
ISelection selection)
|
void
|
update
(org.eclipse.emf.common.notify.Notification notification,
org.eclipse.emf.ecore.EObject element)
Update if nessesary, upon receiving the model event. |
protected void
|
updateColorCache
()
react to selection or model change - updatye local cache |
protected void
|
updateFontBold
()
Update font property |
protected void
|
updateFontFamily
()
Update font family property |
protected void
|
updateFontItalic
()
Update font property |
protected void
|
updateFontSize
()
Update font size property |
Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.properties.sections.
AbstractModelerPropertySection
|
aboutToBeHidden,
aboutToBeShown,
addToEObjectList,
createCommand,
createCommand,
executeAsCompositeCommand,
executeAsReadAction,
getEditingDomain,
getEObject,
getEObjectList,
getEventListener,
getFilter,
getInput,
getPrimarySelection,
getStandardLabelWidth,
getUpdateRequestCollapser,
handleElementModifiedEvent,
isDisposed,
isNotifierDeleted,
isReadOnly,
postUpdateRequest,
setEditingDomain,
setEObject,
update
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
FONT_COLOR_COMMAND_NAME
protected static final java.lang.String FONT_COLOR_COMMAND_NAME
LINE_COLOR_COMMAND_NAME
protected static final java.lang.String LINE_COLOR_COMMAND_NAME
FONT_COMMAND_NAME
protected static final java.lang.String FONT_COMMAND_NAME
FILL_COLOR_COMMAND_NAME
protected static final java.lang.String FILL_COLOR_COMMAND_NAME
FONTS_AND_COLORS_LABEL
protected static final java.lang.String FONTS_AND_COLORS_LABEL
fillColorButton
protected
Button fillColorButton
fillColor
protected
RGB fillColor
fontFamilyCombo
protected
CCombo fontFamilyCombo
DEFAULT_PREF_COLOR
protected static final
RGB DEFAULT_PREF_COLOR
- the default preference color
fontColorButton
protected
Button fontColorButton
lineColorButton
protected
Button lineColorButton
fontColor
protected
RGB fontColor
lineColor
protected
RGB lineColor
colorsAndFontsGroup
protected
Group colorsAndFontsGroup
previousColor
protected int previousColor
ColorsAndFontsPropertySection
public ColorsAndFontsPropertySection()
initializeControls
protected void initializeControls(
Composite parent)
-
Description copied from class:
AbstractNotationPropertiesSection
- Provides a level of indirection for subclasses which want 'jump' over
some control creation/initilialization steps and/or chnage thier order
-
-
Overrides:
-
initializeControls
in class
AbstractNotationPropertiesSection
-
-
Parameters:
-
parent
- - parent composite
createFontsAndColorsGroups
protected
Group createFontsAndColorsGroups(
Composite parent)
- Create fonts and colors group
-
-
Parameters:
-
parent
- - parent composite
createFontsGroup
protected
Composite createFontsGroup(
Composite parent)
- Create font tool bar group
-
-
Parameters:
-
parent
- - parent composite
-
Returns:
- - font tool bar
getInputIterator
protected java.util.Iterator getInputIterator()
-
-
Returns:
- - an itertor object to iterate over the selected/input edit parts
changeLineColor
protected void changeLineColor(
SelectionEvent event)
- Apply line color change
-
-
Parameters:
-
event
- -
line color button selection event
changeFontColor
protected void changeFontColor(
SelectionEvent event)
- Apply font color change
-
-
Parameters:
-
event
- -
font button selection event
changeColor
protected
RGB changeColor(
SelectionEvent event,
Button button,
java.lang.String preferenceId,
java.lang.String propertyId,
java.lang.String commandName,
ImageDescriptor imageDescriptor)
-
Deprecated. The preference is not being retrieved from the correct
preference store so it is not needed, use the other
changeColor
method.
-
-
Parameters:
-
event
- -
selection event -
button
- -
event source -
preferenceId
- -
id of the preference of the default color value for that
property -
propertyId
- -
id of the property -
commandName
- -
name of the command -
imageDescriptor
- -
the image to draw overlay on the button after the new color is
set
-
Returns:
- - new RGB color, or null if none selected
changeColor
protected
RGB changeColor(
SelectionEvent event,
Button button,
java.lang.String propertyId,
java.lang.String commandName,
ImageDescriptor imageDescriptor)
-
-
Parameters:
-
event
- -
selection event -
button
- -
event source -
propertyId
- -
id of the property -
commandName
- -
name of the command -
imageDescriptor
- -
the image to draw overlay on the button after the new color is
set
-
Returns:
- - new RGB color, or null if none selected
updateFontBold
protected void updateFontBold()
- Update font property
-
updateFontItalic
protected void updateFontItalic()
- Update font property
-
updateFontFamily
protected void updateFontFamily()
- Update font family property
-
updateFontSize
protected void updateFontSize()
- Update font size property
-
refresh
public void refresh()
-
-
Specified by:
-
refresh
in interface
ISection
-
Overrides:
-
refresh
in class
AbstractPropertySection
-
update
public void update(org.eclipse.emf.common.notify.Notification notification,
org.eclipse.emf.ecore.EObject element)
- Update if nessesary, upon receiving the model event. This event will only
be processed when the reciever is visible (the default behavior is not to
listen to the model events while not showing). Therefore it is safe to
refresh the UI. Sublclasses, which will choose to override event
listening behavior should take into account that the model events are
sent all the time - regardless of the section visibility. Thus special
care should be taken by the section that will choose to listen to such
events all the time. Also, the default implementation of this method
synchronizes on the GUI thread. The subclasses that overwrite it should
do the same if they perform any GUI work (because events may be sent from
a non-GUI thread).
-
-
Overrides:
-
update
in class
AbstractModelerPropertySection
-
-
Parameters:
-
notification
- notification object -
element
- element that has changed -
See Also:
-
AbstractModelerPropertySection.aboutToBeShown()
,
AbstractModelerPropertySection.aboutToBeHidden()
updateColorCache
protected void updateColorCache()
- react to selection or model change - updatye local cache
-
setInput
public void setInput(
IWorkbenchPart part,
ISelection selection)
-
-
Specified by:
-
setInput
in interface
ISection
-
Overrides:
-
setInput
in class
AbstractModelerPropertySection
-
disposeImage
protected void disposeImage(
Image image)
- Dispose the image if it was created locally to avoid a leak. Do not
dispose the images in the registry.
-
-
Parameters:
-
image
-
dispose
public void dispose()
-
-
Specified by:
-
dispose
in interface
ISection
-
Overrides:
-
dispose
in class
AbstractModelerPropertySection
-
digIntoGroups
protected boolean digIntoGroups()
-
Description copied from class:
AbstractModelerPropertySection
- Override to return true to have this property section work on the shapes
in a
GroupEditPart
as if the shapes were multi-selected.
-
-
Overrides:
-
digIntoGroups
in class
AbstractModelerPropertySection
-
-
Returns:
- true if this property section is to dig into the shapes of groups
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.