Kafenio.editor 0.8.5

de.xeinfach.kafenio
Class KafenioPanelConfiguration

java.lang.Object
  extended byde.xeinfach.kafenio.KafenioPanelConfiguration
All Implemented Interfaces:
KafenioPanelConfigurationInterface

public class KafenioPanelConfiguration
extends java.lang.Object
implements KafenioPanelConfigurationInterface

Description: contains the KafenioPanel configuration, encapsulates the configuration of the editor component.

Author:
Karsten Pawlik

Field Summary
static int APPLET_MODE
           
static int JWS_MODE
           
static int STANDALONE_MODE
           
 
Constructor Summary
KafenioPanelConfiguration()
          default constructor.creates a new instance of this class.
 
Method Summary
 java.awt.Color getBgcolor()
           
 java.lang.String getCodeBase()
           
 java.lang.String getContentParameter()
           
 java.lang.String getCountry()
           
 java.util.Vector getCustomMenuItems()
           
 java.util.Vector getCustomToolBar1()
          keys for the items are the constants from KafenioToolBar class
 java.util.Vector getCustomToolBar2()
          keys for the items are the constants from KafenioToolBar class
 java.lang.String getDocument()
           
 java.lang.String getFileDir()
           
 java.lang.String getImageDir()
           
 java.lang.Object getKafenioParent()
           
 java.lang.String getLanguage()
           
 int getMode()
           
 java.lang.String getOutputmode()
           
 java.lang.String getPostUrl()
           
 java.lang.String getProperty(java.lang.String name)
          returns the value of a property with the given name
 java.lang.String getRawDocument()
           
 java.lang.String getServletMode()
           
 java.lang.String getServletUrl()
           
 java.lang.String getStyleSheet()
           
 java.lang.String[] getStyleSheetFileList()
           
 java.lang.String getTreePilotSystemID()
           
 java.net.URL getUrlStyleSheet()
           
 boolean isApplet()
           
 boolean isBase64()
           
 boolean isDebugMode()
           
 boolean isShowMenuBar()
           
 boolean isShowMenuIcons()
           
 boolean isShowToolbar()
           
 boolean isShowToolbar2()
           
 boolean isShowViewSource()
           
 boolean isStandalone()
           
 boolean isUnicode()
           
 boolean isWebStart()
           
 java.awt.Color parseBgColor(java.lang.String bgColorString)
           
 java.util.Vector parseToolbarItems(java.lang.String aString)
          method to parse a space separated string into a vector.
 void setBase64(boolean b)
           
 void setBgcolor(java.awt.Color color)
           
 void setBgcolor(java.lang.String color)
           
 void setCodeBase(java.lang.String string)
           
 void setContentParameter(java.lang.String string)
           
 void setCountry(java.lang.String string)
           
 void setCustomMenuItems(java.lang.String menuItems)
           
 void setCustomMenuItems(java.util.Vector vector)
           
 void setCustomToolBar1(java.lang.String toolbarItems)
          keys for the items are the constants from KafenioToolBar class
 void setCustomToolBar1(java.util.Vector vector)
          keys for the items are the constants from KafenioToolBar class
 void setCustomToolBar2(java.lang.String toolbarItems)
          keys for the items are the constants from KafenioToolBar class
 void setCustomToolBar2(java.util.Vector vector)
          keys for the items are the constants from KafenioToolBar class
 void setDebugMode(boolean b)
           
 void setDocument(java.lang.String string)
           
 void setFileDir(java.lang.String string)
           
 void setImageDir(java.lang.String string)
           
 void setKafenioParent(java.lang.Object parentApplet)
           
 void setLanguage(java.lang.String string)
           
 void setMode(int newMode)
          sets the parameter that defines if Kafenio should be run as an applet.
 void setOutputmode(java.lang.String string)
          sets the outputmode of the editor.
 void setPostUrl(java.lang.String string)
           
 void setProperty(java.lang.String name, java.lang.String value)
          sets or overwrites a property with the given information.
 void setRawDocument(java.lang.String string)
           
 void setServletMode(java.lang.String newServletMode)
          servlet mode can be either "java" or "cgi". default is "java".
 void setServletUrl(java.lang.String string)
           
 void setShowMenuBar(boolean b)
           
 void setShowMenuIcons(boolean b)
           
 void setShowToolbar(boolean b)
           
 void setShowToolbar2(boolean b)
           
 void setShowViewSource(boolean b)
           
 void setStyleSheet(java.lang.String string)
           
 void setStyleSheetFileList(java.lang.String[] strings)
           
 void setTreePilotSystemID(java.lang.String string)
           
 void setUnicode(boolean unicode)
           
 void setUrlStyleSheet(java.net.URL url)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STANDALONE_MODE

public static final int STANDALONE_MODE
See Also:
Constant Field Values

APPLET_MODE

public static final int APPLET_MODE
See Also:
Constant Field Values

JWS_MODE

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

KafenioPanelConfiguration

public KafenioPanelConfiguration()
default constructor.creates a new instance of this class. the default toolbars are loaded. (as proposed by yangyu)

Method Detail

isApplet

public boolean isApplet()
Specified by:
isApplet in interface KafenioPanelConfigurationInterface
Returns:
returns true if Kafenio should be run in applet mode, false otherwise.

isWebStart

public boolean isWebStart()
Specified by:
isWebStart in interface KafenioPanelConfigurationInterface
Returns:
returns true if Kafenio should be run in web start mode, false otherwise.

isStandalone

public boolean isStandalone()
Specified by:
isStandalone in interface KafenioPanelConfigurationInterface
Returns:
returns true if Kafenio should be run in standalones mode, false otherwise.

isBase64

public boolean isBase64()
Specified by:
isBase64 in interface KafenioPanelConfigurationInterface
Returns:
returns true if document is encoded in base64, false otherwise

getBgcolor

public java.awt.Color getBgcolor()
Specified by:
getBgcolor in interface KafenioPanelConfigurationInterface
Returns:
returns the background color to be set. if not set, the default system value is assumed.

isDebugMode

public boolean isDebugMode()
Specified by:
isDebugMode in interface KafenioPanelConfigurationInterface
Returns:
returns true if applet should be run in debug mode, false otherwise.

getCodeBase

public java.lang.String getCodeBase()
Specified by:
getCodeBase in interface KafenioPanelConfigurationInterface
Returns:
returns the applet's codebase (only applicable for isApplet() == true

getCountry

public java.lang.String getCountry()
Specified by:
getCountry in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set countrycode. if not countrycode is set, the default locale is assumed.

getDocument

public java.lang.String getDocument()
Specified by:
getDocument in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set document.

isShowMenuIcons

public boolean isShowMenuIcons()
Specified by:
isShowMenuIcons in interface KafenioPanelConfigurationInterface
Returns:
returns true if menu icons should be displayed, false otherwise.

isShowViewSource

public boolean isShowViewSource()
Specified by:
isShowViewSource in interface KafenioPanelConfigurationInterface
Returns:
returns true if html source view should be displayed on startup, false otherwise

getLanguage

public java.lang.String getLanguage()
Specified by:
getLanguage in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set language code

getRawDocument

public java.lang.String getRawDocument()
Specified by:
getRawDocument in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set raw document.

getStyleSheet

public java.lang.String getStyleSheet()
Specified by:
getStyleSheet in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set CSS Stylesheet used for this document.

getStyleSheetFileList

public java.lang.String[] getStyleSheetFileList()
Specified by:
getStyleSheetFileList in interface KafenioPanelConfigurationInterface
Returns:
returns the list of CSS Stylesheet files to be included.

getUrlStyleSheet

public java.net.URL getUrlStyleSheet()
Specified by:
getUrlStyleSheet in interface KafenioPanelConfigurationInterface
Returns:
returns the url to the CSS Stylesheet to use.

setMode

public void setMode(int newMode)
sets the parameter that defines if Kafenio should be run as an applet.

Specified by:
setMode in interface KafenioPanelConfigurationInterface
Parameters:
newMode - application mode-ID as specified by constants

setBase64

public void setBase64(boolean b)
Specified by:
setBase64 in interface KafenioPanelConfigurationInterface
Parameters:
b - true if base64 encoding should be used when reading the document into the editor.

setBgcolor

public void setBgcolor(java.awt.Color color)
Specified by:
setBgcolor in interface KafenioPanelConfigurationInterface
Parameters:
color - sets the applications background color.

setBgcolor

public void setBgcolor(java.lang.String color)
Specified by:
setBgcolor in interface KafenioPanelConfigurationInterface
Parameters:
color - parses the string into a color object and then sets the applications background color.

setDebugMode

public void setDebugMode(boolean b)
Specified by:
setDebugMode in interface KafenioPanelConfigurationInterface
Parameters:
b - true if debug mode is enabled, false for debug mode disabled.

setCodeBase

public void setCodeBase(java.lang.String string)
Specified by:
setCodeBase in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the applets codebase to the given value.

setCountry

public void setCountry(java.lang.String string)
Specified by:
setCountry in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the countrycode to use. (i.e.: DE for germany or UK for united kingdom.

setDocument

public void setDocument(java.lang.String string)
Specified by:
setDocument in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the document text

setShowMenuIcons

public void setShowMenuIcons(boolean b)
Specified by:
setShowMenuIcons in interface KafenioPanelConfigurationInterface
Parameters:
b - true if menu icons should be displayed, false otherwise.

setShowViewSource

public void setShowViewSource(boolean b)
Specified by:
setShowViewSource in interface KafenioPanelConfigurationInterface
Parameters:
b - true if sourceview should be displayed, false otherwise.

setLanguage

public void setLanguage(java.lang.String string)
Specified by:
setLanguage in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the language code to use. (i.e.: de for germany or UK for united kingdom)

setRawDocument

public void setRawDocument(java.lang.String string)
Specified by:
setRawDocument in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the raw document text

setStyleSheet

public void setStyleSheet(java.lang.String string)
Specified by:
setStyleSheet in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the css stylesheet for the document.

setStyleSheetFileList

public void setStyleSheetFileList(java.lang.String[] strings)
Specified by:
setStyleSheetFileList in interface KafenioPanelConfigurationInterface
Parameters:
strings - sets the css stylesheet files to use.

setUrlStyleSheet

public void setUrlStyleSheet(java.net.URL url)
Specified by:
setUrlStyleSheet in interface KafenioPanelConfigurationInterface
Parameters:
url - sets the url to the stylesheet to use.

getMode

public int getMode()
Specified by:
getMode in interface KafenioPanelConfigurationInterface
Returns:
returns the current mode of the application as int value.

getCustomMenuItems

public java.util.Vector getCustomMenuItems()
Specified by:
getCustomMenuItems in interface KafenioPanelConfigurationInterface
Returns:
returns vector that contains the keys of the menu items to be included in the menu bar.

setCustomMenuItems

public void setCustomMenuItems(java.util.Vector vector)
Specified by:
setCustomMenuItems in interface KafenioPanelConfigurationInterface
Parameters:
vector - sets the menu items in a vector that contains the keys of the menu items to be included in the menu bar.

setCustomMenuItems

public void setCustomMenuItems(java.lang.String menuItems)
Specified by:
setCustomMenuItems in interface KafenioPanelConfigurationInterface
Parameters:
menuItems - parses the top-level menu items to be shown from the given string.

setShowToolbar

public void setShowToolbar(boolean b)
Specified by:
setShowToolbar in interface KafenioPanelConfigurationInterface
Parameters:
b - true if toolbar 1 is to be displayed.

setShowToolbar2

public void setShowToolbar2(boolean b)
Specified by:
setShowToolbar2 in interface KafenioPanelConfigurationInterface
Parameters:
b - true if toolbar 1 is to be displayed.

setShowMenuBar

public void setShowMenuBar(boolean b)
Specified by:
setShowMenuBar in interface KafenioPanelConfigurationInterface
Parameters:
b - true if menubar should be displayed.

isShowMenuBar

public boolean isShowMenuBar()
Specified by:
isShowMenuBar in interface KafenioPanelConfigurationInterface
Returns:
returns true if menubar should be displayed.

isShowToolbar

public boolean isShowToolbar()
Specified by:
isShowToolbar in interface KafenioPanelConfigurationInterface
Returns:
returns true if toolbar 1 should be displayed.

isShowToolbar2

public boolean isShowToolbar2()
Specified by:
isShowToolbar2 in interface KafenioPanelConfigurationInterface
Returns:
returns true if toolbar 2 should be displayed.

setImageDir

public void setImageDir(java.lang.String string)
Specified by:
setImageDir in interface KafenioPanelConfigurationInterface
Parameters:
string - path to image folder

setFileDir

public void setFileDir(java.lang.String string)
Specified by:
setFileDir in interface KafenioPanelConfigurationInterface
Parameters:
string - path to file folder

getFileDir

public java.lang.String getFileDir()
Specified by:
getFileDir in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set file folder path

getImageDir

public java.lang.String getImageDir()
Specified by:
getImageDir in interface KafenioPanelConfigurationInterface
Returns:
returns the currently set image folder path

setTreePilotSystemID

public void setTreePilotSystemID(java.lang.String string)
Specified by:
setTreePilotSystemID in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the treepilot system id.

getTreePilotSystemID

public java.lang.String getTreePilotSystemID()
Specified by:
getTreePilotSystemID in interface KafenioPanelConfigurationInterface
Returns:
returns the treepilot system id.

setServletUrl

public void setServletUrl(java.lang.String string)
Specified by:
setServletUrl in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the servlet URL that is called when fetching image- or file information for the insert anchor or insert image dialogs.

getServletUrl

public java.lang.String getServletUrl()
Specified by:
getServletUrl in interface KafenioPanelConfigurationInterface
Returns:
returns the servlet URL.

setServletMode

public void setServletMode(java.lang.String newServletMode)
servlet mode can be either "java" or "cgi". default is "java".
if the standard tagging-servlet is used, servlet mode should be "java".
if you're using a php- or perl-script for file-input, the servlet mode should be "cgi".

interface description for mode cgi:
the script can take the following parameters:
the script must output a document of MIME-type text/plain.
the first line of the output defines the http-path to the root directory of your images and files. each further line contains one relative file-path. the path is relative to the root specified in the first line.

i.e.:
physical path to images root directory: /usr/local/httpd/htdocs/images
http path to images root directory: http://www.mydomain.com/images
files in the images root directory: car.gif
files in the images root directory: holiday2002/me.gif
files in the images root directory: holiday2002/myself.gif
files in the images root directory: holiday2002/i.gif
files in the images root directory: holiday2002/mygirlfriend.gif
Sample output of the script:
http://www.mydomain.com/images
car.gif
holiday2002/me.gif
holiday2002/myself.gif
holiday2002/i.gif
holiday2002/mygirlfriend.gif

Specified by:
setServletMode in interface KafenioPanelConfigurationInterface
Parameters:
newServletMode - the current ServletMode (can be "cgi" or "java", case insensitive)

setPostUrl

public void setPostUrl(java.lang.String string)
Specified by:
setPostUrl in interface KafenioPanelConfigurationInterface
Parameters:
string - set url to post content to for saving documents on the web.

getPostUrl

public java.lang.String getPostUrl()
Specified by:
getPostUrl in interface KafenioPanelConfigurationInterface
Returns:
returns the post url.

getServletMode

public java.lang.String getServletMode()
Specified by:
getServletMode in interface KafenioPanelConfigurationInterface
Returns:
returns servlet mode as string.

setContentParameter

public void setContentParameter(java.lang.String string)
Specified by:
setContentParameter in interface KafenioPanelConfigurationInterface
Parameters:
string - sets the content parameter. (the document to edit as string value)

getContentParameter

public java.lang.String getContentParameter()
Specified by:
getContentParameter in interface KafenioPanelConfigurationInterface
Returns:
returns the content as string.

setOutputmode

public void setOutputmode(java.lang.String string)
sets the outputmode of the editor.
normal = output is standard plain-ascii html code off = no content is posted at all base64 = content is posted as base64 encoded ascii-string

Specified by:
setOutputmode in interface KafenioPanelConfigurationInterface
Parameters:
string - outputmode to set (can be "normal", "off" or "base64"

getOutputmode

public java.lang.String getOutputmode()
Specified by:
getOutputmode in interface KafenioPanelConfigurationInterface
Returns:
returns the outputmode as string.

setKafenioParent

public void setKafenioParent(java.lang.Object parentApplet)
Specified by:
setKafenioParent in interface KafenioPanelConfigurationInterface
Parameters:
parentApplet - Parent of KafenioPanel

getKafenioParent

public java.lang.Object getKafenioParent()
Specified by:
getKafenioParent in interface KafenioPanelConfigurationInterface
Returns:
returns the kafenioParent Object.

getCustomToolBar1

public java.util.Vector getCustomToolBar1()
keys for the items are the constants from KafenioToolBar class

Specified by:
getCustomToolBar1 in interface KafenioPanelConfigurationInterface
Returns:
returns vector that contains all items as string for toolbar1

getCustomToolBar2

public java.util.Vector getCustomToolBar2()
keys for the items are the constants from KafenioToolBar class

Specified by:
getCustomToolBar2 in interface KafenioPanelConfigurationInterface
Returns:
returns vector that contains all items as string for toolbar 2

setCustomToolBar1

public void setCustomToolBar1(java.util.Vector vector)
keys for the items are the constants from KafenioToolBar class

Specified by:
setCustomToolBar1 in interface KafenioPanelConfigurationInterface
Parameters:
vector - vector that contains all items as string for toolbar 1

setCustomToolBar1

public void setCustomToolBar1(java.lang.String toolbarItems)
keys for the items are the constants from KafenioToolBar class

Specified by:
setCustomToolBar1 in interface KafenioPanelConfigurationInterface
Parameters:
toolbarItems - string that contains all items as space separated list for toolbar 1

setCustomToolBar2

public void setCustomToolBar2(java.util.Vector vector)
keys for the items are the constants from KafenioToolBar class

Specified by:
setCustomToolBar2 in interface KafenioPanelConfigurationInterface
Parameters:
vector - vector that contains all items as string for toolbar 2

setCustomToolBar2

public void setCustomToolBar2(java.lang.String toolbarItems)
keys for the items are the constants from KafenioToolBar class

Specified by:
setCustomToolBar2 in interface KafenioPanelConfigurationInterface
Parameters:
toolbarItems - string that contains all items as space separated list for toolbar 2

toString

public java.lang.String toString()
Specified by:
toString in interface KafenioPanelConfigurationInterface
Returns:
returns a string representation of this object.

parseToolbarItems

public java.util.Vector parseToolbarItems(java.lang.String aString)
method to parse a space separated string into a vector.

Specified by:
parseToolbarItems in interface KafenioPanelConfigurationInterface
Parameters:
aString - the string to parse.
Returns:
returns a vector containing the parsed substrings.

parseBgColor

public java.awt.Color parseBgColor(java.lang.String bgColorString)
Specified by:
parseBgColor in interface KafenioPanelConfigurationInterface
Parameters:
bgColorString - string that represents the color in RGB (i.e.: #FFFFFF for white.)
Returns:
returns a Color object containing the background color. if the background-parameter was not set, the system default (Color.gray) is returned.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Description copied from interface: KafenioPanelConfigurationInterface
sets or overwrites a property with the given information.

Specified by:
setProperty in interface KafenioPanelConfigurationInterface
Parameters:
name - name of the property (id)
value - value of the property.
See Also:
KafenioPanelConfigurationInterface.setProperty(java.lang.String, java.lang.String)

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: KafenioPanelConfigurationInterface
returns the value of a property with the given name

Specified by:
getProperty in interface KafenioPanelConfigurationInterface
Parameters:
name - name of the property.
Returns:
returns the value of the property.
See Also:
KafenioPanelConfigurationInterface.getProperty(java.lang.String)

isUnicode

public boolean isUnicode()
Specified by:
isUnicode in interface KafenioPanelConfigurationInterface
Returns:
Returns true if unicode support for exported text is turned on. default is false.

setUnicode

public void setUnicode(boolean unicode)
Specified by:
setUnicode in interface KafenioPanelConfigurationInterface
Parameters:
unicode - if set to true, exported document text is in unicode format (no html-entities). default is false.

Kafenio.editor 0.8.5

Copyright © 2003-2004 by Karsten Pawlik. All Rights Reserved. Published under the Lesser General Public License (LGPL)