@PublicAPI public class CodeAssistFactory extends java.lang.Object
JFrame frame = new JFrame("CodeAssist Frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
JTextPane textPane = CodeAssistFactory.createChemicalTermsTextPane(true);
textPane.setPreferredSize(new Dimension(320,240));
frame.getContentPane().add(textPane, BorderLayout.CENTER);
JToolBar toolBar = CodeAssistFactory.getToolBar(textPane);
frame.getContentPane().add(toolBar, BorderLayout.NORTH);
JToolBar operatorToolBar = CodeAssistFactory.getOperatorToolBar(textPane);
operatorToolBar.setOrientation(JToolBar.VERTICAL);
frame.getContentPane().add(operatorToolBar, BorderLayout.WEST);
JLabel checkLabel = CodeAssistFactory.getValidationResultLabel(textPane);
frame.getContentPane().add(checkLabel, BorderLayout.SOUTH);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Modifier and Type | Class and Description |
---|---|
static class |
CodeAssistFactory.CodeAssistConfiguration
Helper class for
CodeAssistFactory to set up CodeAssist |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_KEY_FACTORY_INSTANCE
property key for factory instances
|
Modifier and Type | Method and Description |
---|---|
static javax.swing.JTextPane |
createChemicalTermsTextPane()
Creates a
JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space. Default help text will be shown in empty textpane. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(boolean helpText)
Creates a
JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(boolean helpText,
boolean autoPopup)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(boolean helpText,
boolean autoPopup,
boolean expertMode)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(boolean helpText,
boolean autoPopup,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(boolean helpText,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space. Default help text will be shown in empty textpane. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(CodeAssistFactory.CodeAssistConfiguration config)
Creates a
JTextPane instance with code assist capabilities. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space. Default help text will be shown in empty textpane. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
boolean helpText)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
boolean helpText,
boolean autoPopup)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
boolean helpText,
boolean autoPopup,
boolean expertMode)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
boolean helpText,
boolean autoPopup,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
boolean helpText,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space. Default help text will be shown in empty textpane. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. Available function list will be shown when typing ctrl-space |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
boolean expertMode)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities.Default toolbar configuration will be used for toolbars. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
java.lang.String toolbarConfigPath)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
java.lang.String toolbarConfigPath,
boolean expertMode)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
java.lang.String toolbarConfigPath,
boolean expertMode,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities. |
protected static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
java.lang.String toolbarConfigPath,
boolean expertMode,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context,
boolean addServices)
Creates a
JTextPane instance with code assist capabilities. |
static javax.swing.JTextPane |
createChemicalTermsTextPane(java.lang.String prefix,
java.lang.String helpText,
boolean autoPopup,
java.lang.String toolbarConfigPath,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Deprecated.
use
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane instance with code assist capabilities. |
static javax.swing.JToolBar |
getCusromToolBar(javax.swing.JTextPane textPane,
java.lang.String toolbarID)
Returns a custom toolbar for textPane instance
NOTE: textPane have to be created with this factory
|
javax.swing.JComboBox |
getFavoritesComboBox()
Creates and returns the favorites combo instance
|
static javax.swing.JToolBar |
getOperatorToolBar(javax.swing.JTextPane textPane)
Returns the operator toolbar for textPane instance
NOTE: textPane have to be created with this factory
|
static javax.swing.JToolBar |
getToolBar(javax.swing.JTextPane textPane)
Returns the default toolbar for textPane instance
NOTE: textPane have to be created with this factory
|
static javax.swing.JLabel |
getValidationResultLabel(javax.swing.JTextPane textPane)
Returns a
JLabel instance, dinamically showing validation result of textPane
NOTE: will validate against Molecular Context. |
static javax.swing.JLabel |
getValidationResultLabel(javax.swing.JTextPane textPane,
chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
Returns a
JLabel instance, dinamically showing validation result of textPane
NOTE: textPane have to be created with this factory |
static javax.swing.JLabel |
getValidationResultLabelForReactionContext(javax.swing.JTextPane textPane)
Returns a
JLabel instance, dinamically showing validation result of textPane
NOTE: will validate against Reaction Context. |
void |
insertText(java.lang.String text)
Inserts the given string to textPane at caret position.
|
static void |
reloadCodeCompletionData()
Forces all
CodeAssist instances created with this factory to reload the code completion data. |
void |
saveAsMacro()
Shows the modal macro manager dialog, setting current selection as new macro
|
void |
showInsertFunctionDialog()
Shows the modal insert function dialog
|
void |
showManageFavoritesDialog()
Shows the modal favourite manager dialog
|
void |
showManageMacrosDialog()
Shows the modal macro manager dialog
|
public static final java.lang.String PROPERTY_KEY_FACTORY_INSTANCE
public static javax.swing.JTextPane createChemicalTermsTextPane()
JTextPane
instance with code assist capabilities.JTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.context
- is the data provider contextJTextPane
instance with code assist capabilities.public static javax.swing.JTextPane createChemicalTermsTextPane(boolean helpText)
JTextPane
instance with code assist capabilities.helpText
- flags if default help text is shown in empty textpaneJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(boolean helpText, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.helpText
- flags if default help text is shown in empty textpanecontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(boolean helpText, boolean autoPopup)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.helpText
- flags if default help text is shown in empty textpaneautoPopup
- indicates available function list pops up on any keypressJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(boolean helpText, boolean autoPopup, boolean expertMode)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.helpText
- flags if default help text is shown in empty textpaneautoPopup
- indicates available function list pops up on any keypressexpertMode
- when true, code assist is in expert mode, showing more detailed informations like argumentsJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(boolean helpText, boolean autoPopup, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.helpText
- flags if default help text is shown in empty textpaneautoPopup
- indicates available function list pops up on any keypresscontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixcontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, boolean helpText)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- flags if default help text is shown in empty textpaneJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, boolean helpText, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- flags if default help text is shown in empty textpanecontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, boolean helpText, boolean autoPopup)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- flags if default help text is shown in empty textpaneautoPopup
- indicates available function list pops up on any keypressJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, boolean helpText, boolean autoPopup, boolean expertMode)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- flags if default help text is shown in empty textpaneautoPopup
- indicates available function list pops up on any keypressexpertMode
- when true, code assist is in expert mode, showing more detailed informations like argumentsJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, boolean helpText, boolean autoPopup, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- flags if default help text is shown in empty textpaneautoPopup
- indicates available function list pops up on any keypresscontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- indicates available function list pops up on any keypressJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, boolean expertMode)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- indicates available function list pops up on any keypressexpertMode
- when true, code assist is in expert mode, showing more detailed informations like argumentsJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- indicates available function list pops up on any keypresscontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, java.lang.String toolbarConfigPath)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- available function list pops up on any keypresstoolbarConfigPath
- path to toolbars configuration xmlJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, java.lang.String toolbarConfigPath, boolean expertMode)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- available function list pops up on any keypresstoolbarConfigPath
- path to toolbars configuration xmlexpertMode
- when true, code assist is in expert mode, showing more detailed informations like argumentsJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, java.lang.String toolbarConfigPath, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- available function list pops up on any keypresstoolbarConfigPath
- path to toolbars configuration xmlcontext
- is the data provider contextJTextPane
instance with code assist capabilities.@Deprecated public static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, java.lang.String toolbarConfigPath, boolean expertMode, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
createChemicalTermsTextPane(CodeAssistConfiguration)
Creates a JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- available function list pops up on any keypresstoolbarConfigPath
- path to toolbars configuration xmlexpertMode
- when true, code assist is in expert mode, showing more detailed informations like argumentscontext
- is the data provider contextJTextPane
instance with code assist capabilities.public static javax.swing.JTextPane createChemicalTermsTextPane(CodeAssistFactory.CodeAssistConfiguration config)
JTextPane
instance with code assist capabilities.config
- the behaviour and display configurationJTextPane
instance with code assist capabilities.protected static javax.swing.JTextPane createChemicalTermsTextPane(java.lang.String prefix, java.lang.String helpText, boolean autoPopup, java.lang.String toolbarConfigPath, boolean expertMode, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context, boolean addServices)
JTextPane
instance with code assist capabilities.prefix
- is the code assist invoke prefixhelpText
- is the text displayed in empty textpaneautoPopup
- available function list pops up on any keypresstoolbarConfigPath
- path to toolbars configuration xmlexpertMode
- when true, code assist is in expert mode, showing more detailed informations like argumentscontext
- is the data provider contextaddServices
- if true
services are added to the completion listJTextPane
instance with code assist capabilities.public static javax.swing.JToolBar getToolBar(javax.swing.JTextPane textPane)
textPane
- is the textPane requesting toolbar forpublic static javax.swing.JToolBar getOperatorToolBar(javax.swing.JTextPane textPane)
textPane
- is the textPane requesting toolbar forpublic static javax.swing.JToolBar getCusromToolBar(javax.swing.JTextPane textPane, java.lang.String toolbarID)
textPane
- is the textPane requesting toolbar fortoolbarID
- is the id of the custom toolbar defined in menu configuration xmlpublic static javax.swing.JLabel getValidationResultLabel(javax.swing.JTextPane textPane)
JLabel
instance, dinamically showing validation result of textPane
NOTE: will validate against Molecular Context.
NOTE: textPane have to be created with this factorytextPane
- is the textPane requesting validation label forJLabel
instancegetValidationResultLabel(JTextPane, CodeAssistDataProvider.Context)
,
getValidationResultLabelForReactionContext(JTextPane)
public static javax.swing.JLabel getValidationResultLabelForReactionContext(javax.swing.JTextPane textPane)
JLabel
instance, dinamically showing validation result of textPane
NOTE: will validate against Reaction Context.
NOTE: textPane have to be created with this factorytextPane
- is the textPane requesting validation label forJLabel
instancegetValidationResultLabel(JTextPane, CodeAssistDataProvider.Context)
,
getValidationResultLabel(JTextPane)
public static javax.swing.JLabel getValidationResultLabel(javax.swing.JTextPane textPane, chemaxon.marvin.util.codeassist.CodeAssistDataProvider.Context context)
JLabel
instance, dinamically showing validation result of textPane
NOTE: textPane have to be created with this factorytextPane
- is the textPane requesting validation label forcontext
- is the context used for validatingJLabel
instancepublic javax.swing.JComboBox getFavoritesComboBox()
public void showManageFavoritesDialog()
public void showManageMacrosDialog()
public void showInsertFunctionDialog()
public void saveAsMacro()
public void insertText(java.lang.String text)
text
- is the text to be insertedpublic static void reloadCodeCompletionData()
CodeAssist
instances created with this factory to reload the code completion data.