de.miethxml.hawron.gui.context.editor
Class ExternalEditor

java.lang.Object
  extended byde.miethxml.hawron.gui.context.editor.ExternalEditor
All Implemented Interfaces:
Configurable, Editor

public class ExternalEditor
extends java.lang.Object
implements Editor, Configurable

This class is a wrapper for external editors. The Editor is launched during a System.exec() call.

Author:
Simon Mieth

Field Summary
static java.lang.String PLATFORM_ALL
           
 
Constructor Summary
ExternalEditor()
           
 
Method Summary
 void addEditorCloseListener(EditorCloseListener listener)
           
 void addHandle(java.lang.String handle)
           
 Editor createNewEditor()
           
 void destroy()
           
 void dispose()
           
 java.lang.String getCommand()
           
 java.util.List getHandles()
           
 javax.swing.Icon getIcon()
           
 java.lang.String getIconURL()
           
 java.lang.String getName()
           
 java.lang.String getPlatform()
           
 javax.swing.JComponent getSetup()
           
 java.lang.String getToolTip(java.lang.String lang)
           
 void init()
           
 boolean isSetup()
           
 boolean isSupported(java.lang.String extension)
          This method is called when a file is selected and should give the information back, if the editor can edit this type of file or not.
 boolean isSupportedPlatform()
           
 void newFile(java.lang.String file)
          Edit a new file in the given directory.
 void open(java.lang.String file)
           
 void removeEditorCloseListener(EditorCloseListener listener)
           
 void save()
           
 void setCommand(java.lang.String command)
          Set the execute command for the external editor program.
 void setContextPath(java.lang.String path)
           
 void setHandles(java.util.List handles)
           
 void setIcon(javax.swing.Icon icon)
           
 void setIcon(java.lang.String file)
           
 void setName(java.lang.String name)
           
 void setPlatform(java.lang.String platform)
           
 void setup()
           
 void setVisible(boolean state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLATFORM_ALL

public static java.lang.String PLATFORM_ALL
Constructor Detail

ExternalEditor

public ExternalEditor()
Method Detail

setContextPath

public void setContextPath(java.lang.String path)

isSetup

public boolean isSetup()
Specified by:
isSetup in interface Configurable

getSetup

public javax.swing.JComponent getSetup()

setup

public void setup()
Specified by:
setup in interface Configurable

init

public void init()
Specified by:
init in interface Editor

open

public void open(java.lang.String file)
Specified by:
open in interface Editor

isSupported

public boolean isSupported(java.lang.String extension)
Description copied from interface: Editor
This method is called when a file is selected and should give the information back, if the editor can edit this type of file or not.

Specified by:
isSupported in interface Editor
Parameters:
extension -
Returns:
true if the file is supported otherwise false

save

public void save()
Specified by:
save in interface Editor

dispose

public void dispose()

destroy

public void destroy()

newFile

public void newFile(java.lang.String file)
Description copied from interface: Editor
Edit a new file in the given directory.

Specified by:
newFile in interface Editor
Parameters:
file -

setVisible

public void setVisible(boolean state)
Specified by:
setVisible in interface Editor

getIcon

public javax.swing.Icon getIcon()
Specified by:
getIcon in interface Editor

getToolTip

public java.lang.String getToolTip(java.lang.String lang)
Specified by:
getToolTip in interface Editor

getCommand

public java.lang.String getCommand()
Returns:
Returns the command.

setCommand

public void setCommand(java.lang.String command)
Set the execute command for the external editor program.

Parameters:
command - The execute command to set.

getHandles

public java.util.List getHandles()
Returns:
Returns the handles.

setHandles

public void setHandles(java.util.List handles)
Parameters:
handles - The handles to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

setIcon

public void setIcon(javax.swing.Icon icon)
Parameters:
icon - The icon to set.

setIcon

public void setIcon(java.lang.String file)

getIconURL

public java.lang.String getIconURL()

getPlatform

public java.lang.String getPlatform()
Returns:
Returns the platform.

setPlatform

public void setPlatform(java.lang.String platform)
Parameters:
platform - The platform to set.

isSupportedPlatform

public boolean isSupportedPlatform()

addHandle

public void addHandle(java.lang.String handle)

addEditorCloseListener

public void addEditorCloseListener(EditorCloseListener listener)

removeEditorCloseListener

public void removeEditorCloseListener(EditorCloseListener listener)

createNewEditor

public Editor createNewEditor()
Specified by:
createNewEditor in interface Editor