|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
edu.wpi.ebob.internal.gui.Instance
public class Instance
Represents an instance in the Object Bench. This keeps track of the actual object itself as well as the name of the object.
Nested Class Summary | |
---|---|
protected class |
Instance.MethodComparator
Sorts two methods by name. |
Field Summary | |
---|---|
private org.eclipse.swt.graphics.Color |
bgColor
the background color for all deselected instances. |
private org.eclipse.swt.graphics.Color |
bgColorActive
the current color of this Instance, either bgColor or
bgColorSelected . |
private org.eclipse.swt.graphics.Color |
bgColorSelected
the background color for the one selected instance, if such an instance is selected. |
private org.eclipse.swt.widgets.Label |
classLabel
displays what Class the object is. |
protected static int |
DEFAULT_HEIGHT
size of instance |
protected static int |
DEFAULT_WIDTH
size of instance |
private org.eclipse.swt.graphics.Color |
fgColor
the foreground color for this instance. |
private org.eclipse.swt.graphics.Font |
font
the font that all labels will be given. |
private java.lang.String |
name
the name of the object. |
private org.eclipse.swt.widgets.Label |
nameLabel
displays the name of the object. |
private IObject |
obj
the object to keep track of. |
private org.eclipse.core.runtime.Preferences.IPropertyChangeListener |
prefChangeListener
|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
Instance(org.eclipse.swt.widgets.Composite parent,
java.lang.String name,
IObject obj)
Creates a new instance using obj as the underlying object
and name as its name. |
Method Summary | |
---|---|
void |
addListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
Makes sure children widgets also add the listeners they need. |
protected void |
changeProperty(java.lang.String property)
changes a property of the instance based on a preference change. |
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint)
|
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed)
|
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
java.lang.String |
getInstanceName()
|
IObject |
getObject()
|
void |
inspect()
launches the properties view. |
void |
menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
A callback function that adds the instance-specific menu actions to the manager . |
protected void |
paintControl(org.eclipse.swt.events.PaintEvent pe)
Handles drawing the background rectangle. |
private void |
refreshLabelColors()
Sets the background color of the labels to the current background color. |
private void |
refreshLabelDetails()
Sets the bounds and text for the labels, dependent on the size of the control. |
private void |
setBGColor()
Sets the background color to the preferred color. |
private void |
setFGColor()
Sets the foreground color to the preferred color. |
void |
setInstanceName(java.lang.String name)
Sets the name of this instance to name . |
protected void |
setLabelText(org.eclipse.swt.widgets.Label label,
java.lang.String text)
Sets the label's text to text , provided there is enough
horizontal space to accomodate it. |
void |
setMenu(org.eclipse.swt.widgets.Menu menu)
sets menu for both this control as well as all controls which are children of this control. |
void |
setSelected(boolean isSelected)
Sets this Instance's selected state to isSelected . |
private void |
setSelectedBGColor()
Sets the background color to the preferred color. |
java.lang.String |
toString()
|
protected void |
widgetDisposed()
Handles disposing of the widget and anything in it that wouldn't otherwise get disposed. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_WIDTH
protected static final int DEFAULT_HEIGHT
private org.eclipse.swt.graphics.Color fgColor
private org.eclipse.swt.graphics.Color bgColor
private org.eclipse.swt.graphics.Color bgColorSelected
private org.eclipse.swt.graphics.Color bgColorActive
bgColor
or
bgColorSelected
.
private org.eclipse.swt.widgets.Label classLabel
Class
the object is.
private org.eclipse.swt.graphics.Font font
private java.lang.String name
private org.eclipse.swt.widgets.Label nameLabel
private IObject obj
private org.eclipse.core.runtime.Preferences.IPropertyChangeListener prefChangeListener
Constructor Detail |
---|
public Instance(org.eclipse.swt.widgets.Composite parent, java.lang.String name, IObject obj)
obj
as the underlying object
and name
as its name.
name
- The name given to the object.obj
- The object represented by this instance.Method Detail |
---|
public void addListener(int eventType, org.eclipse.swt.widgets.Listener listener)
addListener
in class org.eclipse.swt.widgets.Widget
Widget.addListener(int, Listener)
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint)
computeSize
in class org.eclipse.swt.widgets.Control
Control.computeSize(int, int)
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class org.eclipse.swt.widgets.Composite
Control.computeSize(int, int, boolean)
public java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
IAdaptable.getAdapter(java.lang.Class)
public java.lang.String getInstanceName()
public IObject getObject()
public void inspect()
protected void paintControl(org.eclipse.swt.events.PaintEvent pe)
pe
- the paint event.private void refreshLabelColors()
private void refreshLabelDetails()
public void setInstanceName(java.lang.String name)
name
.
name
- The new name for this instance.protected void setLabelText(org.eclipse.swt.widgets.Label label, java.lang.String text)
text
, provided there is enough
horizontal space to accomodate it. Otherwise, the last few characters of
the label's text are replaced by an ellipsis and the label's tooltip text
is set to the full value of text
.
label
- the label to set the text on.text
- the desired textpublic void setSelected(boolean isSelected)
isSelected
.
isSelected
- true
if this Instance should be selected,
false
otherwise.public java.lang.String toString()
toString
in class org.eclipse.swt.widgets.Widget
Object.toString()
protected void widgetDisposed()
private void setFGColor()
OBPreferencePage.P_FG_COLOR
private void setBGColor()
OBPreferencePage.P_BG_COLOR
private void setSelectedBGColor()
OBPreferencePage.P_BG_COLOR
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
manager
. This also adds a Separator with
IWorkbenchActionConstants.MB_ADDITIONS
.
public void setMenu(org.eclipse.swt.widgets.Menu menu)
setMenu
in class org.eclipse.swt.widgets.Control
Control.setMenu(Menu)
protected void changeProperty(java.lang.String property)
property
- the property you wish to change, from OBPreferencePage
.OBPreferencePage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |