Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATA_KEY |
static java.lang.String |
DESIGN_FILENAME |
static java.lang.String |
DESIGN_FILENAME_BASE |
static java.lang.String |
LAYOUT_EXT |
Constructor and Description |
---|
Layouts() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(Layout layout,
java.util.HashMap listeners) |
void |
activateDefaultDesignLayout() |
void |
activateLayout(IdeLayout layout) |
void |
activateLayout(IdeLayout layout,
boolean startup) |
void |
activateLayout(Layout child) |
void |
activatePreferredLayout(LayoutSelector selector) |
boolean |
add(Element element)
Add the specified Element from this Folder.
|
void |
addLayoutListener(java.lang.String viewName,
LayoutListener listener) |
void |
addLayoutResetListener(LayoutResetListener l)
Adds the given listener to the list of listeners to notify when layouts are
reset to original factory settings.
|
void |
addStartupLayoutListener(java.lang.String viewName,
LayoutListener listener) |
void |
addView(ViewId id,
View view) |
java.net.URL |
buildLayoutURL(java.lang.String baseName)
Build a layout URL using
baseName as the unqualified file
name. |
boolean |
canAdd(Element element)
Other classes can call this method to determine whether the given
Element can be added to the Folder . |
boolean |
canRemove(Element element)
Other classes can call this method to determine whether the
specified
Element can be removed from this
Folder . |
protected void |
close(Layout layout) |
boolean |
containsChild(Element child)
|
protected void |
copyToImpl(Layouts copy) |
boolean |
equals(java.lang.Object o) |
protected boolean |
equalsImpl(Layouts other) |
static IdeLayout |
findLayout(java.lang.String name) |
protected java.net.URL |
generateLayoutURL() |
Layout |
getActive() |
IdeLayout |
getActiveLayout()
Returns the active layout.
|
Layout |
getActiveSubLayout() |
java.util.Map<java.net.URL,Element> |
getAllLayouts()
Returns map of all registered IdeLayouts.
|
Attributes |
getAttributes()
This method returns an
Attributes object that encodes the
attributes of the Element . |
protected static java.lang.String |
getBaseName() |
java.util.Iterator |
getChildren()
This method is part of the
Element interface to
provide a convenient way of getting an Iterator over any
contained child Element s without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type. |
java.lang.Object |
getData()
Gets the data object that implements this interface.
|
IdeLayout |
getDesignLayout() |
protected static java.net.URL |
getDirectoryURL() |
javax.swing.Icon |
getIcon()
Returns an
Icon that can be shown in association with this
Displayable . |
BaseLayoutListener |
getLayoutListener(java.lang.String type) |
static Layouts |
getLayouts()
Returns the active Layouts instance.
|
java.lang.String |
getLongLabel()
Gets a fully qualified label for display purpose.
|
java.lang.String |
getShortLabel()
Gets a short label for display purpose.
|
java.lang.String |
getToolTipText()
Returns the tool tip text to show when the mouse pointer pauses
over a UI component that represents this
Displayable . |
View |
getView(ViewId id) |
void |
initialize()
Invoked by the
AddinManager after the instance of the
Addin is instantiated. |
boolean |
isDesignActive() |
boolean |
isShowLayoutActivator()
Indicates whether or not the combo box used for layout activation
should be shown in the toolbar.
|
boolean |
isUseActiveLayoutInEditor()
Indicates whether or not to use the active layout in the currently
active editor.
|
boolean |
isUseEditorPreferredLayout()
Indicates whether or not editors should used their preferred layouts.
|
java.util.List<LayoutResetListener> |
layoutResetListeners() |
boolean |
mayHaveChildren()
This method is part of the
Element interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof operator or having to downcast to a
more specific type. |
Layout |
newDesignLayout(java.net.URL url)
Creates a
SimpleLayout owned by the Design layout. |
Layout |
newLayout(IdeLayout parent) |
Layout |
newLayout(IdeLayout parent,
java.net.URL fileURL) |
boolean |
remove(Element element)
Remove the specified Element from this Folder.
|
void |
removeAll()
Removes all children from the folder.
|
void |
removeLayoutResetListener(LayoutResetListener l)
Removes the given listener from the list of listeners to notify when
layouts are reset to original factory settings.
|
void |
saveAll() |
static void |
setLayouts(Layouts layouts)
Sets the Layouts instance.
|
void |
setShowLayoutActivator(boolean showActivator)
Indicate whether or not the combo box used for layout activation
should be shown in the toolbar.
|
void |
setUseActiveLayoutInEditor(boolean useActiveLayoutInEditor)
Indicate whether or not to use the active layout in the currently
active editor.
|
void |
setUseEditorPreferredLayout(boolean useEditorPreferredLayout)
Indicate whether or not editors should use their preferred layouts.
|
int |
size()
Returns the current number of children in the folder.
|
void |
update(Layout layout) |
protected void |
update(Layout layout,
java.util.Iterator iter) |
protected void |
updateStartupLayout() |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public static final java.lang.String DATA_KEY
public static final java.lang.String LAYOUT_EXT
public static final java.lang.String DESIGN_FILENAME_BASE
public static final java.lang.String DESIGN_FILENAME
public static Layouts getLayouts()
public static void setLayouts(Layouts layouts)
public void addLayoutListener(java.lang.String viewName, LayoutListener listener)
public void addStartupLayoutListener(java.lang.String viewName, LayoutListener listener)
public void initialize()
Addin
AddinManager
after the instance of the
Addin
is instantiated. When invoked, The Addin
should register and menu items, and actions required for use during this
classes lifecycle. Addin
authors should take care to ensure
that any extraneous initialization is not preformed on this method, and
any startup code that can be delayed until a later time is delayed, as
the Addin
's are synchronously initialized during the
startup of the IDE, and each Addin
has the potential to
negatively impact the startup time of the product.initialize
in interface Addin
AddinManager
public IdeLayout getActiveLayout()
public Layout getActiveSubLayout()
public Layout getActive()
public void activateLayout(IdeLayout layout)
public void activateLayout(IdeLayout layout, boolean startup)
public boolean isDesignActive()
public void activatePreferredLayout(LayoutSelector selector)
public void activateLayout(Layout child)
public void activateDefaultDesignLayout()
public java.net.URL buildLayoutURL(java.lang.String baseName)
baseName
as the unqualified file
name. A file extension is added and the system directory is used
as the parent directory.public Layout newDesignLayout(java.net.URL url)
SimpleLayout
owned by the Design layout.public IdeLayout getDesignLayout()
public void update(Layout layout)
public void saveAll()
public BaseLayoutListener getLayoutListener(java.lang.String type)
public java.lang.String getShortLabel()
getShortLabel
in interface Displayable
public java.lang.String getLongLabel()
getLongLabel
in interface Displayable
public javax.swing.Icon getIcon()
Displayable
Icon
that can be shown in association with this
Displayable
. Typically the icon will be used in a
tree control or list control. Therefore the icon must fit
naturally within the space normally given to items within those
controls. Such icons are usually 16x16 in size or, if there is a
one-pixel transparent padding around the edge, 18x18 in size. It
is strongly recommended that icons returned by this method be
either 16x16 or 18x18 in size. If null
is returned,
the control may show a default icon, or it may show no icon,
whichever is appropriate.getIcon
in interface Displayable
public boolean mayHaveChildren()
Element
Element
interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof
operator or having to downcast to a
more specific type.
An implementation of Element
that represents a leaf
in a tree structure should return false
from this
method. An implementation of Element
that could
represent a non-leaf in a tree structure should return
true
from this method, even if it does not currently
contain any children.
mayHaveChildren
in interface Element
public java.util.Iterator getChildren()
Element
Element
interface to
provide a convenient way of getting an Iterator
over any
contained child Element
s without having to test the
object's type with the instanceof
operator or having
to downcast to a more specific type.
An implementation of Element
that represents a leaf
in a tree structure should return null
from this
method. An implementation of Element
that could
represent a non-leaf in a tree structure should return either an
Iterator
over the child Element
s or
null
if there are no children.
getChildren
in interface Element
public java.lang.String getToolTipText()
Displayable
Displayable
.
In many cases it may be appropriate for this method to return the
same value as Displayable.getLongLabel()
.getToolTipText
in interface Displayable
public java.lang.Object getData()
public Attributes getAttributes()
Element
Attributes
object that encodes the
attributes of the Element
. Changing the attribute
settings on the return object changes the element attributes.
Subclasses should use their super class attributes object to
define their own attributes. This allows subclasses to
inherit their super class attributes. If a subclass does not
wish to inherit attributes, they should first call
getAttributes().clear()
and define new attributes.getAttributes
in interface Element
public boolean add(Element element)
public boolean remove(Element element)
public boolean canRemove(Element element)
Folder
Element
can be removed from this
Folder
.canRemove
in interface Folder
element
- the Element being checked for removal from this folderpublic boolean canAdd(Element element)
Folder
Element
can be added to the Folder
.public boolean containsChild(Element child)
Folder
containsChild
in interface Folder
public int size()
Folder
public void removeAll()
Folder
public boolean isUseEditorPreferredLayout()
public void setUseEditorPreferredLayout(boolean useEditorPreferredLayout)
public boolean isShowLayoutActivator()
public void setShowLayoutActivator(boolean showActivator)
public boolean isUseActiveLayoutInEditor()
public void setUseActiveLayoutInEditor(boolean useActiveLayoutInEditor)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected final boolean equalsImpl(Layouts other)
protected final void copyToImpl(Layouts copy)
protected static java.lang.String getBaseName()
protected static java.net.URL getDirectoryURL()
protected java.net.URL generateLayoutURL()
protected void close(Layout layout)
protected void activate(Layout layout, java.util.HashMap listeners)
protected void updateStartupLayout()
protected void update(Layout layout, java.util.Iterator iter)
public void addLayoutResetListener(LayoutResetListener l)
l
- the listener to add.public void removeLayoutResetListener(LayoutResetListener l)
l
- the listener to remove.public java.util.List<LayoutResetListener> layoutResetListeners()
public java.util.Map<java.net.URL,Element> getAllLayouts()
public static IdeLayout findLayout(java.lang.String name)