org.formaria.editor.netbeans.project.pages
Class PagePanel

java.lang.Object
  extended by CloneableTopComponent
      extended by org.formaria.editor.netbeans.project.pages.PagePanel
All Implemented Interfaces:
Modifiable, EventHandlerEditor, IPagePanel

public class PagePanel
extends CloneableTopComponent
implements Modifiable, EventHandlerEditor, IPagePanel

UI support for editing the a page. Opens the the XML in a separate window

Copyright (c) Formaria Ltd., 2002-2003

$Revision: 1.60 $

License: see License.txt


Field Summary
static java.lang.String DEFAULT_COMPONENT_INSPECTOR_MODE
           
static java.lang.String DEFAULT_COMPONENT_PALETTE_MODE
           
static java.lang.String DEFAULT_COMPONENT_PROPERTIES_MODE
           
static java.lang.String DEFAULT_LAYER_PALETTE_MODE
           
static java.lang.String DEFAULT_STYLE_PALETTE_MODE
           
static int MODE_VISUAL
           
static int MODE_XML
           
 
Fields inherited from interface org.formaria.editor.project.pages.IPagePanel
NO_OPTION, YES_OPTION
 
Constructor Summary
PagePanel()
          for externalization only
PagePanel(MultiDataObject.Entry entry, CloseOperationState cos)
           
 
Method Summary
 void activatePagePanel()
           
 void add(java.lang.Object component, java.lang.Object constraint)
          Add a component to the container
 CloseOperationState canCloseElement()
           
 void componentActivated()
           
 void componentChanged()
           
 void componentClosed()
           
 void componentDeactivated()
           
 void componentHidden()
           
 void componentOpened()
           
 void componentShowing()
           
protected  CloneableTopComponent createClonedObject()
           
 IComponentInspector createInspector()
           
 ILayerPalette createLayerPalette()
           
 IComponentPalette createPalette()
           
 IComponentProperties createPropertiesPanel()
           
 IStylePalette createStylePalette()
           
 java.lang.Object getChild(int i)
           
 int getChildCount()
           
 PageResource getCurrentPage()
           
 PageDataObject getCurrentPageDataObject()
           
 PageDataObject getCurrentPageDataObject(java.lang.String name, java.lang.String ext)
          Get the PageDataObject for the specified file
 ExplorerManager getExplorerManager()
           
 HelpCtx getHelpCtx()
           
 ILayerManager getLayerManager()
           
 int getMode()
           
 Notifiable getNotifiable()
           
 javax.swing.JPanel getPageContainer()
           
 PageDataObject getPageDataObject(java.lang.String name)
           
 PageDesigner getPageDesigner()
           
 int getPersistenceType()
           
 EditorProject getProject()
          Get the project to which this page belongs.
 javax.swing.JComponent getToolbarRepresentation()
           
 javax.swing.JComponent getVisualRepresentation()
           
 int getXmlEditorHash()
           
 void hideComponents(boolean isClosing)
           
 boolean isFocusable()
           
 boolean isModified()
           
 boolean isXmlDirty()
           
 void open()
           
 java.lang.String preferredId()
           
 boolean processKeyBinding(javax.swing.KeyStroke ks, java.awt.event.KeyEvent e, int condition, boolean pressed)
           
 void readExternal(java.io.ObjectInput oi)
           
 void regenerateXml()
           
 void remove(java.lang.Object o)
          Remove an object from the container
 boolean reparsePageXml(java.lang.String pageName)
           
 void setAllModified(java.lang.String pageName, java.lang.String ext)
           
 void setMode(int mode)
           
 void setModified(boolean newState)
           
 void setModified(PageDataObject pdo, PageResource ep, boolean newState, PageCookie pCookie)
           
 void setMultiViewCallback(MultiViewElementCallback callback)
           
 void showComponents()
           
 int showConfirmDialog(java.lang.Object parent, java.lang.String message, java.lang.String title, int type)
           
 void showEventHandler(PageResource page, java.awt.Component source, java.lang.String methodName, java.lang.Class klass, boolean ctrlDown)
          Show the Java source code at the point of the specified method
 void showEventHandler(PageResource page, java.awt.Component source, java.lang.String methodName, long mask, boolean ctrlDown)
          Show the Java source code at the point of the specified method
 void showPage(int pageIdx)
           
 void showPageEventHandler(PageResource page, java.lang.String methodName, boolean ctrlDown)
           
protected  void updateNameAndIcon(DataObject o, Node n)
           
 void updatePageEditor()
          The XML has been edited, save it to the internal objects
 void updateXmlEditor(java.lang.String xml)
           
 void writeExternal(java.io.ObjectOutput oo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.formaria.editor.project.pages.IPagePanel
doLayout, getComponent, getComponentCount, validate
 

Field Detail

DEFAULT_COMPONENT_PROPERTIES_MODE

public static java.lang.String DEFAULT_COMPONENT_PROPERTIES_MODE

DEFAULT_COMPONENT_INSPECTOR_MODE

public static java.lang.String DEFAULT_COMPONENT_INSPECTOR_MODE

DEFAULT_COMPONENT_PALETTE_MODE

public static java.lang.String DEFAULT_COMPONENT_PALETTE_MODE

DEFAULT_STYLE_PALETTE_MODE

public static java.lang.String DEFAULT_STYLE_PALETTE_MODE

DEFAULT_LAYER_PALETTE_MODE

public static java.lang.String DEFAULT_LAYER_PALETTE_MODE

MODE_VISUAL

public static final int MODE_VISUAL
See Also:
Constant Field Values

MODE_XML

public static final int MODE_XML
See Also:
Constant Field Values
Constructor Detail

PagePanel

public PagePanel(MultiDataObject.Entry entry,
                 CloseOperationState cos)

PagePanel

public PagePanel()
for externalization only

Method Detail

isFocusable

public boolean isFocusable()

setMode

public void setMode(int mode)

showPage

public void showPage(int pageIdx)
Specified by:
showPage in interface IPagePanel

getXmlEditorHash

public int getXmlEditorHash()
Specified by:
getXmlEditorHash in interface IPagePanel

getMode

public int getMode()

createClonedObject

protected CloneableTopComponent createClonedObject()

writeExternal

public void writeExternal(java.io.ObjectOutput oo)
                   throws java.io.IOException
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput oi)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

open

public void open()

updateNameAndIcon

protected void updateNameAndIcon(DataObject o,
                                 Node n)

getHelpCtx

public HelpCtx getHelpCtx()

preferredId

public java.lang.String preferredId()

getPersistenceType

public int getPersistenceType()
Returns:

getProject

public EditorProject getProject()
Description copied from interface: IPagePanel
Get the project to which this page belongs.

Specified by:
getProject in interface IPagePanel

createPalette

public IComponentPalette createPalette()
Specified by:
createPalette in interface IPagePanel

createInspector

public IComponentInspector createInspector()
Specified by:
createInspector in interface IPagePanel

createPropertiesPanel

public IComponentProperties createPropertiesPanel()
Specified by:
createPropertiesPanel in interface IPagePanel

createStylePalette

public IStylePalette createStylePalette()
Specified by:
createStylePalette in interface IPagePanel

createLayerPalette

public ILayerPalette createLayerPalette()
Specified by:
createLayerPalette in interface IPagePanel

setAllModified

public void setAllModified(java.lang.String pageName,
                           java.lang.String ext)
Specified by:
setAllModified in interface IPagePanel

isXmlDirty

public boolean isXmlDirty()

updatePageEditor

public void updatePageEditor()
The XML has been edited, save it to the internal objects

Specified by:
updatePageEditor in interface IPagePanel

updateXmlEditor

public void updateXmlEditor(java.lang.String xml)
Specified by:
updateXmlEditor in interface IPagePanel

regenerateXml

public void regenerateXml()
Specified by:
regenerateXml in interface IPagePanel

setModified

public void setModified(boolean newState)
Specified by:
setModified in interface Modifiable
Specified by:
setModified in interface IPagePanel

setModified

public void setModified(PageDataObject pdo,
                        PageResource ep,
                        boolean newState,
                        PageCookie pCookie)

isModified

public boolean isModified()
Specified by:
isModified in interface Modifiable

getNotifiable

public Notifiable getNotifiable()
Specified by:
getNotifiable in interface Modifiable

componentClosed

public void componentClosed()

componentHidden

public void componentHidden()

componentOpened

public void componentOpened()

componentShowing

public void componentShowing()

activatePagePanel

public void activatePagePanel()

setMultiViewCallback

public void setMultiViewCallback(MultiViewElementCallback callback)

getVisualRepresentation

public javax.swing.JComponent getVisualRepresentation()

getToolbarRepresentation

public javax.swing.JComponent getToolbarRepresentation()

canCloseElement

public CloseOperationState canCloseElement()

componentActivated

public void componentActivated()

showComponents

public void showComponents()
Specified by:
showComponents in interface IPagePanel

hideComponents

public void hideComponents(boolean isClosing)
Specified by:
hideComponents in interface IPagePanel

getPageDataObject

public PageDataObject getPageDataObject(java.lang.String name)

showEventHandler

public void showEventHandler(PageResource page,
                             java.awt.Component source,
                             java.lang.String methodName,
                             long mask,
                             boolean ctrlDown)
Show the Java source code at the point of the specified method

Specified by:
showEventHandler in interface EventHandlerEditor
Parameters:
page - the page resource that owns the method
source - the component that initiates the event
methodName - the response method name
mask - the event mask

showEventHandler

public void showEventHandler(PageResource page,
                             java.awt.Component source,
                             java.lang.String methodName,
                             java.lang.Class klass,
                             boolean ctrlDown)
Show the Java source code at the point of the specified method

Specified by:
showEventHandler in interface EventHandlerEditor
Parameters:
page - the page resource that owns the method
source - the component that initiates the event
methodName - the response method name
klass - the event class

showPageEventHandler

public void showPageEventHandler(PageResource page,
                                 java.lang.String methodName,
                                 boolean ctrlDown)
Specified by:
showPageEventHandler in interface EventHandlerEditor

reparsePageXml

public boolean reparsePageXml(java.lang.String pageName)

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface IPagePanel

getChild

public java.lang.Object getChild(int i)
Specified by:
getChild in interface IPagePanel

getCurrentPage

public PageResource getCurrentPage()

getExplorerManager

public ExplorerManager getExplorerManager()

getCurrentPageDataObject

public PageDataObject getCurrentPageDataObject(java.lang.String name,
                                               java.lang.String ext)
Get the PageDataObject for the specified file

Parameters:
name - the file name
ext - the file extension
Returns:
the data object

getCurrentPageDataObject

public PageDataObject getCurrentPageDataObject()

componentDeactivated

public void componentDeactivated()

componentChanged

public void componentChanged()

getPageContainer

public javax.swing.JPanel getPageContainer()
Specified by:
getPageContainer in interface IPagePanel

getPageDesigner

public PageDesigner getPageDesigner()

getLayerManager

public ILayerManager getLayerManager()
Specified by:
getLayerManager in interface IPagePanel

add

public void add(java.lang.Object component,
                java.lang.Object constraint)
Add a component to the container

Specified by:
add in interface IPagePanel
Parameters:
component - the component to add
constraint - the layout constraint

remove

public void remove(java.lang.Object o)
Remove an object from the container

Specified by:
remove in interface IPagePanel
Parameters:
o - the component to remove

showConfirmDialog

public int showConfirmDialog(java.lang.Object parent,
                             java.lang.String message,
                             java.lang.String title,
                             int type)
Specified by:
showConfirmDialog in interface IPagePanel

processKeyBinding

public boolean processKeyBinding(javax.swing.KeyStroke ks,
                                 java.awt.event.KeyEvent e,
                                 int condition,
                                 boolean pressed)