org.formaria.editor.project.pages
Class PageDesigner

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.formaria.editor.project.pages.PageDesigner
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.MenuListener, PageDisplay, SizerListener, ToolbarSelectionListener, ProjectListener

public class PageDesigner
extends javax.swing.JPanel
implements PageDisplay, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, SizerListener, ProjectListener, javax.swing.event.MenuListener, java.awt.event.ComponentListener, ToolbarSelectionListener

A panel to allow visual editing of the page. Opens the Java source code (if any) in a separate window.

Copyright (c) Formaria Ltd., 2002-2007

$Revision: 1.77 $

License: see License.txt

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int ID_MENU_ALIGN_BOTTOM
           
static int ID_MENU_ALIGN_CENTER
           
static int ID_MENU_ALIGN_LEFT
           
static int ID_MENU_ALIGN_RIGHT
           
static int ID_MENU_ALIGN_TOP
           
static int ID_MENU_ARRANGE_BACK
           
static int ID_MENU_ARRANGE_BOTTOM
           
static int ID_MENU_ARRANGE_FORWARD
           
static int ID_MENU_ARRANGE_TOP
           
static int ID_MENU_COPY
           
static int ID_MENU_CUT
           
static int ID_MENU_DELETE
           
static int ID_MENU_JUSTIFY_HORZ
           
static int ID_MENU_JUSTIFY_VERT
           
static int ID_MENU_PASTE
           
static int ID_MENU_SHOW_INSITU
           
static int ID_MENU_SHOW_MENU
           
static int ID_MENU_SNAP
           
static int ID_MENU_SNAP_GRID
           
static int ID_MENU_SNAP_GUIDES
           
static int ID_MENU_SNAP_SIBLINGS
           
static int ID_MENU_SPACE_HORZ
           
static int ID_MENU_SPACE_VERT
           
protected  java.util.Hashtable managerObjects
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PageDesigner(PagePanel owner)
          Creates a new instance of PageDesigner
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Respond to events such as menu selections
 void addComponentSelectionListener(ComponentSelectListener listener)
           
 void addEditorComponentListener(EditorComponentListener listener)
           
 void addListeners(java.awt.Container page, boolean isRoot)
           
 java.awt.Component addNewComponent(java.awt.Component comp, java.awt.Point pt, boolean addMultiple)
           
 java.awt.Component addNewComponent(java.awt.Component comp, java.awt.Point pt, boolean addMultiple, java.lang.String pendingComp)
           
 ContentHolder addTarget(java.lang.String name, java.lang.Object constraint, int preferredWidth, int preferredHeight, java.util.Hashtable params)
          Add a new frame or target area to a frameset
 void alignSelectedComponents(int command)
          Change the component alignment
 void cancelTimer()
          Cancel the delayed hiding of the in-situ editing
 boolean canPaste()
           
 void checkProject(EditorProject project)
          Check the project
 void clearSelectedComponents()
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 void componentSized()
          Update the state to reflect changes to the components
 void componentSized(boolean realign)
          Update the state to reflect changes to the components
 void copy()
          Add all of the selected components to the componentClipboard Vector.
 void cut()
          Call copy which adds all of the selected components to the componentClipboard Vector.
 void deleteSelection()
          Delete the selected items
 java.lang.Object displayDecoration(PageSupport page, java.lang.String constraint)
          Display a window decoration, for example a toolbar
 java.lang.Object displayPage(PageSupport page)
          Called when a page has been added with the PageManager
 java.lang.Object displayPage(PageSupport page, java.lang.Object attributes)
          Called when a page needs to be displayed.
 java.lang.Object displayPage(PageSupport page, java.lang.String target)
          Called when a page needs to be displayed.
 java.lang.Object displayPage(PageSupport page, java.lang.String target, java.lang.Object attributes)
          Called when a page needs to be displayed.
 void doAlignSelectedComponents(int command, java.util.Vector selComps)
          Change the component alignment for a single container
 void editDefaultProperty()
           
 MenuEditor findMenuEditor()
          Get the menu editor belonging to a pagePanel
 java.lang.Object findTarget(java.lang.String name)
          Get a named frame/target from the current frameset
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 PageResource getContentPage()
          Get the name of the page in the content panel
 void getContextMenu(javax.swing.JPopupMenu popupMenu, java.awt.AWTEvent evt)
           
 java.lang.String getCurrentPageExtension()
           
 java.lang.String getCurrentPageName()
           
static IEditorUtility getEditorUtility()
           
 GuidePane getGuidePane()
          Get the guide pane
 int getInSituMode()
          Get the in-situ editing mode
 java.lang.String getJavaFileName()
          Get the name of the java source file for this page
 java.lang.String getJavaFileName(java.lang.String className)
          Get the name of the source code file
 int getLastMousePressedButton()
          Get the last mouse pressed button identifier
 ILayerManager getLayerManager()
          Get the layer manager
 java.awt.Dimension getMinimumSize()
           
 int getNumTargets()
          Get the number of frame/target from the current frameset
 java.lang.Object getObject(java.lang.String key)
          Get a manager object
 PagePanel getOwnerPage()
          Get the owner page
 PageResource getPageResource()
          Get the current page
 java.awt.Dimension getPreferredSize()
           
 java.util.Vector getSelectedComponents()
           
 EditorComponentFactory getStyleFactory()
          Get the style factory
 java.lang.annotation.Target getTarget(java.awt.Component cont)
          Get the target area parent for a component
 java.lang.annotation.Target getTarget(int idx)
          Get the target area parent for a component
 boolean hasGuides()
           
 boolean hasPasteContent()
          Check that there are items to paste
protected  void hideInSituMode()
          Clear the in-situ editing mode
 boolean isAddingComponent()
           
 boolean isStaticMethod(java.lang.String methodName)
          Is this a static method reference
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 PageResource loadPage(java.lang.String pageName, java.lang.String ext, java.lang.String target, int pageWidth, int pageHeight)
          Load a page into the named area
 boolean locateMethod(java.lang.String methodName, boolean addNewMethod, PageResource ownerPageRes, boolean ctrlDown)
          Locates the method specified by the parameter methodName.
 void menuCanceled(javax.swing.event.MenuEvent e)
           
 void menuDeselected(javax.swing.event.MenuEvent e)
           
 void menuSelected(javax.swing.event.MenuEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent evt)
           
 void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseEntered(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mouseMoved(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
protected  void moveComponent(int mode)
          Change the z-order of a component
 void openPageSource(boolean activate)
          Open the Java source code for the current page.
 void openPageSource(PageResource pageResource, boolean activate)
          Open the Java source code for the current page.
 void paste()
          first check that the componentClipboard is not null and then effectively clone each component found in it.
 void projectInitialized(EditorProject project)
          Notification of project initialized.
 void projectLoaded(EditorProject project)
          Notification of a project load
 void projectUpdated(EditorProject project)
          The project has been updated
 void removeAllTargets()
          Remove all frames/targets from the current frameset
 void removeListeners(java.awt.Container page)
           
 void reselectComponents()
          Tells the page designer to reselect the components to reflect changes which may have to be reflected in the properties table.
 void resetListeners()
          Reset the page listeners after a build
 void resetProject(java.lang.String moduleName, EditorProject project)
          Inform a project that it should reset any object references it has stored
 void resetStyles()
           
 void saveProject(EditorProject project)
          Notification the project is being saved
 void selectAllIntersecting(java.awt.Container parent, java.awt.Rectangle rect, boolean cutSelection)
          Add all the components intersecting the rectangle to the current selection
 void selectComponent(java.awt.Component selection, boolean init)
           
 void setCurrentPageModified()
          Mark the current page as modified
static void setEditorUtility(IEditorUtility eu, boolean isEclipse)
           
 void setEventHandlerEditor(EventHandlerEditor ehe)
           
 void setLastMousePressedButton(int b)
          Set the last mouse pressed button identifier
protected  void setModified(java.awt.Component comp)
          Set the NetBeans cookies and objects as modified for the referenced component
 void setMouseDownLocation(java.awt.Point p)
          Set the location of the popup menu
 void setObject(java.lang.String key, java.lang.Object obj)
          Set the manager object
 void setPage(Page page)
           
 void setScreen(java.lang.String name, java.lang.String ext, java.lang.String methodName, boolean create)
          First set the current source in the Project.
 void setupFrameset(java.util.Hashtable params)
          Setup frameset.
protected  void showDialog(Page dialog)
          Show the dialog in design mode.
 void showGuides(boolean showGuides)
           
protected  void showInSituMode(java.awt.Component c, java.awt.Point p)
          Show the rollover in-situ editing
 void showLaf(boolean showSystemLaf)
          Use the system look and feel.
 void showMenu()
          Call copy which adds all of the selected components to the componentClipboard Vector.
 void sizeGuidePane()
          Change the size of the guide pane to match that of this window
 void startTimer()
           
 void textValueChanged(java.awt.event.TextEvent e)
           
 int toggleInSituMode()
          Move to the next in-situ editing mode
 void toolSelected(java.lang.String comp, EditorComponentAdapter eca)
          Notification that a tool was selected
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.formaria.aria.PageDisplay
doLayout
 

Field Detail

ID_MENU_CUT

public static final int ID_MENU_CUT
See Also:
Constant Field Values

ID_MENU_COPY

public static final int ID_MENU_COPY
See Also:
Constant Field Values

ID_MENU_PASTE

public static final int ID_MENU_PASTE
See Also:
Constant Field Values

ID_MENU_DELETE

public static final int ID_MENU_DELETE
See Also:
Constant Field Values

ID_MENU_SHOW_MENU

public static final int ID_MENU_SHOW_MENU
See Also:
Constant Field Values

ID_MENU_SHOW_INSITU

public static final int ID_MENU_SHOW_INSITU
See Also:
Constant Field Values

ID_MENU_SNAP

public static final int ID_MENU_SNAP
See Also:
Constant Field Values

ID_MENU_SNAP_GRID

public static final int ID_MENU_SNAP_GRID
See Also:
Constant Field Values

ID_MENU_SNAP_GUIDES

public static final int ID_MENU_SNAP_GUIDES
See Also:
Constant Field Values

ID_MENU_SNAP_SIBLINGS

public static final int ID_MENU_SNAP_SIBLINGS
See Also:
Constant Field Values

ID_MENU_ALIGN_LEFT

public static final int ID_MENU_ALIGN_LEFT
See Also:
Constant Field Values

ID_MENU_ALIGN_RIGHT

public static final int ID_MENU_ALIGN_RIGHT
See Also:
Constant Field Values

ID_MENU_ALIGN_TOP

public static final int ID_MENU_ALIGN_TOP
See Also:
Constant Field Values

ID_MENU_ALIGN_BOTTOM

public static final int ID_MENU_ALIGN_BOTTOM
See Also:
Constant Field Values

ID_MENU_ALIGN_CENTER

public static final int ID_MENU_ALIGN_CENTER
See Also:
Constant Field Values

ID_MENU_JUSTIFY_HORZ

public static final int ID_MENU_JUSTIFY_HORZ
See Also:
Constant Field Values

ID_MENU_JUSTIFY_VERT

public static final int ID_MENU_JUSTIFY_VERT
See Also:
Constant Field Values

ID_MENU_SPACE_HORZ

public static final int ID_MENU_SPACE_HORZ
See Also:
Constant Field Values

ID_MENU_SPACE_VERT

public static final int ID_MENU_SPACE_VERT
See Also:
Constant Field Values

ID_MENU_ARRANGE_BOTTOM

public static final int ID_MENU_ARRANGE_BOTTOM
See Also:
Constant Field Values

ID_MENU_ARRANGE_BACK

public static final int ID_MENU_ARRANGE_BACK
See Also:
Constant Field Values

ID_MENU_ARRANGE_FORWARD

public static final int ID_MENU_ARRANGE_FORWARD
See Also:
Constant Field Values

ID_MENU_ARRANGE_TOP

public static final int ID_MENU_ARRANGE_TOP
See Also:
Constant Field Values

managerObjects

protected java.util.Hashtable managerObjects
Constructor Detail

PageDesigner

public PageDesigner(PagePanel owner)
Creates a new instance of PageDesigner

Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

showGuides

public void showGuides(boolean showGuides)

sizeGuidePane

public void sizeGuidePane()
Change the size of the guide pane to match that of this window


componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

addComponentSelectionListener

public void addComponentSelectionListener(ComponentSelectListener listener)

addEditorComponentListener

public void addEditorComponentListener(EditorComponentListener listener)

setPage

public void setPage(Page page)

addListeners

public void addListeners(java.awt.Container page,
                         boolean isRoot)

removeListeners

public void removeListeners(java.awt.Container page)

displayPage

public java.lang.Object displayPage(PageSupport page)
Called when a page has been added with the PageManager

Specified by:
displayPage in interface PageDisplay
Parameters:
page - The Page which has been loaded.
Returns:
the page being displayed

displayPage

public java.lang.Object displayPage(PageSupport page,
                                    java.lang.Object attributes)
Called when a page needs to be displayed.

Parameters:
page - the new page
target - the name of the target area to update
attribs - attributes for use by the new page / taregt
Returns:
the page being displayed

menuCanceled

public void menuCanceled(javax.swing.event.MenuEvent e)
Specified by:
menuCanceled in interface javax.swing.event.MenuListener

menuDeselected

public void menuDeselected(javax.swing.event.MenuEvent e)
Specified by:
menuDeselected in interface javax.swing.event.MenuListener

menuSelected

public void menuSelected(javax.swing.event.MenuEvent e)
Specified by:
menuSelected in interface javax.swing.event.MenuListener

canPaste

public boolean canPaste()

hasGuides

public boolean hasGuides()

isAddingComponent

public boolean isAddingComponent()

openPageSource

public void openPageSource(boolean activate)
Open the Java source code for the current page.


openPageSource

public void openPageSource(PageResource pageResource,
                           boolean activate)
Open the Java source code for the current page.


showMenu

public void showMenu()
Call copy which adds all of the selected components to the componentClipboard Vector. Then remove the selected components to the pageHolder.


findMenuEditor

public MenuEditor findMenuEditor()
Get the menu editor belonging to a pagePanel

Returns:
the editor if any.

cut

public void cut()
Call copy which adds all of the selected components to the componentClipboard Vector. Then remove the selected components to the pageHolder.


copy

public void copy()
Add all of the selected components to the componentClipboard Vector.


paste

public void paste()
first check that the componentClipboard is not null and then effectively clone each component found in it. This is done by creating the basic component using the styleFactory. This creates the new component with the basic properties after which the component helper is called to set component specific properties. Add the keyListener and mouseListener for selecting and moving the new component.


hasPasteContent

public boolean hasPasteContent()
Check that there are items to paste

Returns:
true if there are items to paste

setMouseDownLocation

public void setMouseDownLocation(java.awt.Point p)
Set the location of the popup menu

Parameters:
p - the point

deleteSelection

public void deleteSelection()
Delete the selected items


getContextMenu

public void getContextMenu(javax.swing.JPopupMenu popupMenu,
                           java.awt.AWTEvent evt)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Respond to events such as menu selections

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e -

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

focusGained

public void focusGained(java.awt.event.FocusEvent e)

focusLost

public void focusLost(java.awt.event.FocusEvent e)

textValueChanged

public void textValueChanged(java.awt.event.TextEvent e)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

addNewComponent

public java.awt.Component addNewComponent(java.awt.Component comp,
                                          java.awt.Point pt,
                                          boolean addMultiple)

addNewComponent

public java.awt.Component addNewComponent(java.awt.Component comp,
                                          java.awt.Point pt,
                                          boolean addMultiple,
                                          java.lang.String pendingComp)

setModified

protected void setModified(java.awt.Component comp)
Set the NetBeans cookies and objects as modified for the referenced component

Parameters:
comp - the new/modified component

setCurrentPageModified

public void setCurrentPageModified()
Mark the current page as modified


alignSelectedComponents

public void alignSelectedComponents(int command)
Change the component alignment

Parameters:
command - the menu id used to invoke the option

doAlignSelectedComponents

public void doAlignSelectedComponents(int command,
                                      java.util.Vector selComps)
Change the component alignment for a single container

Parameters:
command - the menu id used to invoke the option
useParent - align within parent

componentSized

public void componentSized()
Update the state to reflect changes to the components

Specified by:
componentSized in interface SizerListener

componentSized

public void componentSized(boolean realign)
Update the state to reflect changes to the components

Parameters:
realign - true to realign the components to the guides and grid

reselectComponents

public void reselectComponents()
Tells the page designer to reselect the components to reflect changes which may have to be reflected in the properties table.


toolSelected

public void toolSelected(java.lang.String comp,
                         EditorComponentAdapter eca)
Description copied from interface: ToolbarSelectionListener
Notification that a tool was selected

Specified by:
toolSelected in interface ToolbarSelectionListener
Parameters:
comp - the key that identifies the tool

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

selectAllIntersecting

public void selectAllIntersecting(java.awt.Container parent,
                                  java.awt.Rectangle rect,
                                  boolean cutSelection)
Add all the components intersecting the rectangle to the current selection

Parameters:
rect - the selection rectangle

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener

editDefaultProperty

public void editDefaultProperty()

hideInSituMode

protected void hideInSituMode()
Clear the in-situ editing mode


startTimer

public void startTimer()

cancelTimer

public void cancelTimer()
Cancel the delayed hiding of the in-situ editing


toggleInSituMode

public int toggleInSituMode()
Move to the next in-situ editing mode

Returns:
th enew in-situ editing mode

getInSituMode

public int getInSituMode()
Get the in-situ editing mode

Returns:
the in-situ editing mode

showInSituMode

protected void showInSituMode(java.awt.Component c,
                              java.awt.Point p)
Show the rollover in-situ editing


getCurrentPageName

public java.lang.String getCurrentPageName()

getCurrentPageExtension

public java.lang.String getCurrentPageExtension()

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

selectComponent

public void selectComponent(java.awt.Component selection,
                            boolean init)

getContentPage

public PageResource getContentPage()
Get the name of the page in the content panel

Returns:
the content page name

getLayerManager

public ILayerManager getLayerManager()
Get the layer manager

Returns:
the layer manager

loadPage

public PageResource loadPage(java.lang.String pageName,
                             java.lang.String ext,
                             java.lang.String target,
                             int pageWidth,
                             int pageHeight)
Load a page into the named area

Parameters:
pageName - the page name
ext - the file extension
target - the name of the target area
pageWidth - the page width
pageHeight - the page height

showDialog

protected void showDialog(Page dialog)
Show the dialog in design mode. Do some of the things that are done when a dialog is displayed at runtime.

Parameters:
dialog - the dialog class instance

getJavaFileName

public java.lang.String getJavaFileName(java.lang.String className)
Get the name of the source code file


displayDecoration

public java.lang.Object displayDecoration(PageSupport page,
                                          java.lang.String constraint)
Display a window decoration, for example a toolbar

Specified by:
displayDecoration in interface PageDisplay
Parameters:
page - the new page
constraint - a value controlling how and where the decoration is displayed, this value is application type specific
Returns:
the page being displayed

showLaf

public void showLaf(boolean showSystemLaf)
Use the system look and feel.

Parameters:
showSystemLaf - true to use the system look and feel, otherwise use the Java look and feel

getGuidePane

public GuidePane getGuidePane()
Get the guide pane


getOwnerPage

public PagePanel getOwnerPage()
Get the owner page

Returns:
the owner page

getPageResource

public PageResource getPageResource()
Get the current page

Returns:
the page instance

projectInitialized

public void projectInitialized(EditorProject project)
Description copied from interface: ProjectListener
Notification of project initialized.

Specified by:
projectInitialized in interface ProjectListener
Parameters:
project - the editor project just initialized

projectLoaded

public void projectLoaded(EditorProject project)
Description copied from interface: ProjectListener
Notification of a project load

Specified by:
projectLoaded in interface ProjectListener
Parameters:
project - the editor project just loaded

setLastMousePressedButton

public void setLastMousePressedButton(int b)
Set the last mouse pressed button identifier

Parameters:
b - the button index

getLastMousePressedButton

public int getLastMousePressedButton()
Get the last mouse pressed button identifier

Returns:
the button index

projectUpdated

public void projectUpdated(EditorProject project)
The project has been updated

Specified by:
projectUpdated in interface ProjectListener

saveProject

public void saveProject(EditorProject project)
Description copied from interface: ProjectListener
Notification the project is being saved

Specified by:
saveProject in interface ProjectListener
Parameters:
project - the editor project to save

checkProject

public void checkProject(EditorProject project)
Description copied from interface: ProjectListener
Check the project

Specified by:
checkProject in interface ProjectListener
Parameters:
project - the editor project to check

resetProject

public void resetProject(java.lang.String moduleName,
                         EditorProject project)
Description copied from interface: ProjectListener
Inform a project that it should reset any object references it has stored

Specified by:
resetProject in interface ProjectListener
Parameters:
moduleName - the name of the module that caused/required the reload
project - the editor project to check

resetStyles

public void resetStyles()

resetListeners

public void resetListeners()
Reset the page listeners after a build


getSelectedComponents

public java.util.Vector getSelectedComponents()

clearSelectedComponents

public void clearSelectedComponents()

addTarget

public ContentHolder addTarget(java.lang.String name,
                               java.lang.Object constraint,
                               int preferredWidth,
                               int preferredHeight,
                               java.util.Hashtable params)
Description copied from interface: PageDisplay
Add a new frame or target area to a frameset

Specified by:
addTarget in interface PageDisplay
Parameters:
name - the frame name
constraint - the BorderlayoutConstraint
preferredWidth - the preferred width
preferredHeight - the preferred height
params - extra parameters for the target
Returns:
the new target

displayPage

public java.lang.Object displayPage(PageSupport page,
                                    java.lang.String target)
Description copied from interface: PageDisplay
Called when a page needs to be displayed.

Specified by:
displayPage in interface PageDisplay
Parameters:
page - the new page
target - the name of the target area to update
Returns:
the page being displayed

displayPage

public java.lang.Object displayPage(PageSupport page,
                                    java.lang.String target,
                                    java.lang.Object attributes)
Description copied from interface: PageDisplay
Called when a page needs to be displayed.

Specified by:
displayPage in interface PageDisplay
Parameters:
page - the new page
target - the name of the target area to update
Returns:
the page being displayed

setEventHandlerEditor

public void setEventHandlerEditor(EventHandlerEditor ehe)

getJavaFileName

public java.lang.String getJavaFileName()
Get the name of the java source file for this page

Returns:
the file name

setScreen

public void setScreen(java.lang.String name,
                      java.lang.String ext,
                      java.lang.String methodName,
                      boolean create)
First set the current source in the Project. Get the screen specified by the parameter 'name'. If there is no source defined create a template file if the create parameter is true. Set the text of the JEditTextArea and set it to visible.

Parameters:
name - The name of the screen we are trying to load
ext - the file name extension
methodName - the name of the method
create - If true create a template file for the source if not found.

locateMethod

public boolean locateMethod(java.lang.String methodName,
                            boolean addNewMethod,
                            PageResource ownerPageRes,
                            boolean ctrlDown)
Locates the method specified by the parameter methodName. if the addNewMethod is true the method specified by methodName is created. The cursor is position at the start of the method.

Parameters:
methodName - The name of the method we are looking for.
addNewMethod - If true create the method if not found.
pageRes - the page resources that owns the method or null
Returns:
true if a new method was added

isStaticMethod

public boolean isStaticMethod(java.lang.String methodName)
Is this a static method reference

Parameters:
methodName - the method name
Returns:
true if the method is a static method reference

getStyleFactory

public EditorComponentFactory getStyleFactory()
Get the style factory


getTarget

public java.lang.annotation.Target getTarget(java.awt.Component cont)
Get the target area parent for a component


getTarget

public java.lang.annotation.Target getTarget(int idx)
Get the target area parent for a component

Specified by:
getTarget in interface PageDisplay
Parameters:
idx - the target area
Returns:
the container to be updated

removeAllTargets

public void removeAllTargets()
Description copied from interface: PageDisplay
Remove all frames/targets from the current frameset

Specified by:
removeAllTargets in interface PageDisplay

findTarget

public java.lang.Object findTarget(java.lang.String name)
Description copied from interface: PageDisplay
Get a named frame/target from the current frameset

Specified by:
findTarget in interface PageDisplay
Parameters:
name - the name of the frame
Returns:
the target frame

setupFrameset

public void setupFrameset(java.util.Hashtable params)
Setup frameset. This method is called prior to the addition of any target areas in the framset and prior to the display of any pages

Specified by:
setupFrameset in interface PageDisplay
Parameters:
params - the framset parameters if any

getNumTargets

public int getNumTargets()
Get the number of frame/target from the current frameset

Specified by:
getNumTargets in interface PageDisplay
Returns:
the number of target frames

moveComponent

protected void moveComponent(int mode)
Change the z-order of a component

Parameters:
mode - the ordering mode

getObject

public java.lang.Object getObject(java.lang.String key)
Get a manager object

Parameters:
key - the name of the object e.g. "Routes", "Services"
Returns:
the object instance or null if it hasn't been added

setObject

public void setObject(java.lang.String key,
                      java.lang.Object obj)
Set the manager object

Parameters:
key - the name of the object e.g. "Routes", "Services"
obj - the object instance

setEditorUtility

public static void setEditorUtility(IEditorUtility eu,
                                    boolean isEclipse)

getEditorUtility

public static IEditorUtility getEditorUtility()