|
org.netbeans.modules.looks/2 1.12 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.spi.looks.Look
org.netbeans.spi.looks.DefaultLook
public abstract class DefaultLook
Utility class for providing Looks. Some methods are linked together to make it easier for subclasses to implement reasonable functionality (iconBase, actionBase), etc.
Field Summary |
---|
Fields inherited from class org.netbeans.spi.looks.Look |
---|
ALL_METHODS, CAN_COPY, CAN_CUT, CAN_DESTROY, CAN_RENAME, CLIPBOARD_COPY, CLIPBOARD_CUT, DESTROY, DRAG, GET_ACTIONS, GET_CHILD_OBJECTS, GET_CONTEXT_ACTIONS, GET_CUSTOMIZER, GET_DEFAULT_ACTION, GET_DISPLAY_NAME, GET_DROP_TYPE, GET_HELP_CTX, GET_ICON, GET_LOOKUP_ITEMS, GET_NAME, GET_NEW_TYPES, GET_OPENED_ICON, GET_PASTE_TYPES, GET_PROPERTY_SETS, GET_SHORT_DESCRIPTION, HAS_CUSTOMIZER, NO_METHODS, RENAME |
Constructor Summary | |
---|---|
DefaultLook(String name)
Creates new instance of look does no work. |
Method Summary | |
---|---|
protected String |
actionBase(Object representedObject,
boolean context,
Lookup env)
Allows subclasses to specify actions in a easy way - by providing a name of a context name where to find the javax.swing.Action objects. |
Action[] |
getActions(Object representedObject,
Lookup env)
Calls actionBase (substitute, false) and extracts actions from that context. |
Action[] |
getContextActions(Object representedObject,
Lookup env)
Calls actionBase (substitute, true) and extracts actions from that context. |
Action |
getDefaultAction(Object representedObject,
Lookup env)
Extracts the first action from getActions, if any. |
Image |
getIcon(Object representedObject,
int type,
Lookup env)
Finds icon using the value returned from iconBase |
Image |
getOpenedIcon(Object representedObject,
int type,
Lookup env)
Finds icon using the value returned from iconBase |
boolean |
hasCustomizer(Object representedObject,
Lookup env)
Check whether the customizer for the represented object is available. |
protected String |
iconBase(Object representedObject,
Lookup env)
Allows subclasses to specify an icon in easier way without need to load the actual objects. |
Methods inherited from class org.netbeans.spi.looks.Look |
---|
attachTo, canCopy, canCut, canDestroy, canRename, clipboardCopy, clipboardCut, destroy, detachFrom, drag, fireChange, firePropertyChange, getChildObjects, getCustomizer, getDisplayName, getDisplayName, getDropType, getHelpCtx, getLookupItems, getName, getName, getNewTypes, getPasteTypes, getPropertySets, getShortDescription, isLeaf, rename, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultLook(String name)
name
- the name to assign to the lookMethod Detail |
---|
public Image getIcon(Object representedObject, int type, Lookup env)
representedObject
- Parameter is ignored.type
- Icon type constant from BeanInfo
env
- Parameter is ignored.
null
if not foundpublic Image getOpenedIcon(Object representedObject, int type, Lookup env)
getOpenedIcon
in class Look
representedObject
- Parameter is ignored.type
- Icon type constant from BeanInfo
env
- Parameter is ignored.
null
if not foundpublic Action[] getActions(Object representedObject, Lookup env)
getActions
in class Look
representedObject
- Parameter is ignored.env
- Parameter is ignored.
null
public Action[] getContextActions(Object representedObject, Lookup env)
getContextActions
in class Look
representedObject
- Parameter is ignored.env
- Parameter is ignored.
null
public Action getDefaultAction(Object representedObject, Lookup env)
getDefaultAction
in class Look
representedObject
- Parameter is ignored.env
- Parameter is ignored.
null
public boolean hasCustomizer(Object representedObject, Lookup env)
hasCustomizer
in class Look
representedObject
- Parameter is ignored.env
- Parameter is ignored.
protected String iconBase(Object representedObject, Lookup env)
For example, if the returned base is /resource/MyIcon
, the
following images may be used according to the icon state and
presentation type
:
resource/MyIcon.gif
resource/MyIconOpen.gif
resource/MyIcon32.gif
resource/MyIconOpen32.gif
The default implementation returns null.
representedObject
- The substitute to locate icon for.env
- Environement of the object.
null
if this look does not provide an iconprotected String actionBase(Object representedObject, boolean context, Lookup env)
By default the method returns name of this class (separated by slashes)
with a prefix Looks/Actions. So for a class org.nb.mymod.MyLook
the default action context is Looks/Actions/org/nb/mymod/MyLook.
As a result it is not necessary to override this method in many cases.
representedObject
- The object to work on.context
- false if getActions
was called,
true if getContextActions
was calledenv
- Environement for the object.
|
org.netbeans.modules.looks/2 1.12 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |