Class Activator
- All Implemented Interfaces:
IWebServiceEngine
,IKStringInfoProviderHolder
,org.osgi.framework.BundleActivator
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Debug setting for Undo.static final PropFactory
The Designer property factory.static final PropMgr
The Property Manager for the Designer.static final GProp<?>[]
The empty array.static IFileURLResolver
Interface used to resolve URL's to files for the Designer.static final IResource[]
An empty resource array.static final String
The plug-in ID: "com.iizigo" as in package name for this class.protected static final long
The serial UID.static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
The resource setup.static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
static final PropertyEditorSetup
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionvoid
addServerLaunchOptions
(List<String> args) Adds required options for the server when launched from inside iiziGo.static boolean
areAllResourceBased
(GProp<?>[] props) Checks if the properties only contains resources.static void
centerDialog
(Shell shell) Centers a dialog box Shell over it's parent shell on the same monitor as the parent shell.static int
checkEnabledOrStarting
(Shell shell, IWizard wizard) Call this function in e.g.static int
checkEnabledOrStarting
(Shell shell, IWizard wizard, Runnable runnable) Call this function in e.g.void
Configures a Http(s)URLConnection for proxy information.static PropMgr
Creates a Property Manager for the Designer connection with JavaScript.static Status
createErrorStatus
(String msg) Creates an error status.static Status
createErrorStatus
(String msg, Throwable e) Creates an error status.static Status
createInfoStatus
(String msg) Creates an informational status.static byte[]
createInputData
(PropCnr container) Creates InputStream byte array data from a property container.static InputStream
createInputStream
(PropCnr container) Creates an InputStream from a property container.createKStringInfoProvider
(GProp<?> anyProp, boolean shouldResolve) Creates an IKStringInfoProvider for a property.static PropFactory
Creates a new Server property factory.static PropMgr
createServerPropMgr
(boolean hasJSClient) Creates a new Property Manager for a Server simulation.static Status
Creates a warning status.static DesignerProp
Converts the DesignerProp from the data container to the FilePropCnr one, if it refers to a file.static GProp<?>
dataToFile
(GProp<?> gp) Converts the property to get the FilePropCnr instead of the data container property.static GProp<?>[]
dataToFile
(GProp<?>[] props) Converts the array of properties to get the FilePropCnr instead of the data container property.static void
Disposes of the clipboard.static int
errorMessageBox
(Shell shell, String title, String msg, CoreException e) Shows an error message box from any thread for an exception.static DesignerProp
Converts the property to get the data container property instead of a FilePropCnr.static GProp<?>
fileToData
(GProp<?> gp) Converts the property to get the data container property instead of a FilePropCnr.static GProp<?>[]
fileToData
(GProp<?>[] props) Converts the array of properties to get the data container property instead of a FilePropCnr.static String
getByteSize
(long size) Gets a size string in bytes.static Clipboard
Gets the clip board instance for the plug-in.static org.osgi.service.prefs.Preferences
Gets the iiziGo Configuration Preferences, not stored in the workspace, but with the Eclipse installation.Gets the classpath entries for the IIZI Core.Gets the database directory to use.Gets the database directory candidate to use.static ExecutorService
Gets the executor service.static IFile
getFirstSelectedFile
(IStructuredSelection selection) Gets the first selected file resource.static DesignerProp
Gets the first currently selected property.static DesignerProp
Gets the first currently selected property.static GProp<?>[]
getGProps
(List<DesignerProp> list) Gets a list of all GProp's for the DesignerProp's list.static Activator
Returns the shared instance.static int
Returns the current HTTP port for the internal web server.static File
Gets the JDBC drivers directory, a user local directory that always should exist.Retrieves the KStringInfoProvider.getKStringInfoProvider
(GProp<?> anyProp) Retrieves the KStringInfoProvider.Gets the classpath entries for IIZI Plug-ins.static IProject
getProject
(Object o) Attempts to get the project from an Object, first as an IProject, then a DesignerProp, then as an adapted IResource.static PropCnr[]
getPropCnrs
(ArrayList<DesignerProp> list) Gets a PropCnr's from a DesignerProp list.Gets a Java Proxy instance for an URL.static PropCnr
getRootProperty
(String name) Gets a root property from a registered name.static IRuntimeBuilder
Gets the runtime creation builder.static GProp<?>[]
Gets a list of all GProp's for DesignerProp's in a selection that should be used in e.g.static IProject
Gets the currently selected project.static IProject
Gets the first selected project.static IProject[]
Gets all selected projects.static ArrayList<DesignerProp>
Gets a list of all DesignerProp's in a selection that should be used in e.g.Gets a list of all RAW GProp's without DesignerProp's in a selection that should be used in e.g.static IResource[]
Returns the resource selection from the LocalSelectionTransfer.static IResource[]
getSelectedResources
(ISelection selection) Returns the resource selection.static IResource[]
getSelectedResources
(IStructuredSelection selection) Returns the resource selection.static PropFactory
Gets the Server property factory.static Shell
Gets a shell.static File
getStateLocationFile
(String fileName) Gets a file in the state location area.static File
Gets the user's private directory, normally where the other directories are placed, such as the JDBC drivers "jdbc-drivers", the database "db", etc.static Worker
Gets the Worker.static boolean
Returns if IIZI is enabled or not.static boolean
isResourceBased
(GProp<?> gp) Checks if the property contains a resource.static boolean
Checks if IIZI is currently starting up.static boolean
Checks if plugin is stopped or not started at all.static PropCnr
loadPropertiesFile
(File file) Loads a properties file.static PropCnr
loadPropertiesFile
(URL url) Loads a properties file.static PropCnr
loadPropertiesFile
(IFile file) Loads a properties file.static void
mergeStatus
(MultiStatus status, IStatus toMerge) Adds the given status to the list of problems.static int
messageBox
(String title, String msg, int style) Shows a message box.static int
messageBox
(Shell shell, String title, String msg, int style) Shows a message box.static void
messageBoxAsync
(String title, String msg, int style) Shows a message box asynchronously in the SWT Thread.static void
Opens an error dialog if necessary.static void
Opens an error dialog if necessary.static void
openError
(String genericTitle, CoreException exception) Opens an error dialog if necessary.static void
Opens an error dialog if necessary.static void
Opens an error dialog if necessary.static void
Opens an error dialog if necessary.static void
openError
(Shell shell, String genericTitle, CoreException exception) Opens an error dialog if necessary.static void
Opens an error dialog if necessary.static void
openExceptionDetailsError
(Shell shell, String genericTitle, IStatus status) Opens an error dialog if necessary.static void
Opens an URL in an external browser.static void
prepareFolder
(IFolder folder, IProgressMonitor monitor) Prepares a folder, i.e.static void
refresh
(Collection<DesignerProp> dps) Refreshes the workspace for the specified properties.static boolean
registerRootProperty
(String name, PropCnr root) Registers a root property container not being a Java or Module root, e.g.static void
savePropertiesFile
(PropCnr container, IFile file, IProgressMonitor monitor) Saves a properties file.static void
setEnabled
(boolean isEnabled) Assigns the enabled state of IIZI.static void
Sets the runtime creation builder.void
start
(org.osgi.framework.BundleContext context) Starts up the iiziGo plug-in bundle.static int
statusMessageBox
(Shell shell, String title, String msg, IStatus status) Shows a message box from any thread.void
stop
(org.osgi.framework.BundleContext context) static int
threadMessageBox
(String title, String msg, int style) Shows a message box from another thread.static int
threadMessageBox
(Shell shell, String title, String msg, int style) Shows a message box from another thread.static boolean
unregisterRootProperty
(String name, PropCnr root) Unregisters a root property container not being a Java or Module root, e.g.Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
Field Details
serialVersionUID
protected static final long serialVersionUIDThe serial UID.- See Also:
PLUGIN_ID
The plug-in ID: "com.iizigo" as in package name for this class.- See Also:
DEBUG_UNDO
public static final boolean DEBUG_UNDODebug setting for Undo.- See Also:
NO_RESOURCES
An empty resource array.EMPTY_GPROPS
The empty array.designerFactory
The Designer property factory.designerPropertyManager
The Property Manager for the Designer.setupPanel
The resource setup.setupSelector
setupStyle
setupImage
setupVS
setupResource
setupTextTable
setupModuleApp
setupServerConfig
setupServerMonitor
setupAppDist
setupPush
setupPWA
setupRuntimeBuilder
setupFont
fileURLResolver
Interface used to resolve URL's to files for the Designer. In other products, the same URL is returned unchanged.
Constructor Details
Activator
public Activator()The Eclipse constructor.
Method Details
isEnabled
public static boolean isEnabled()Returns if IIZI is enabled or not.- Returns:
- true if IIZI is enabled, false otherwise.
isStartingUp
public static boolean isStartingUp()Checks if IIZI is currently starting up.- Returns:
- true if IIZI is still starting up, false if ready.
setEnabled
public static void setEnabled(boolean isEnabled) Assigns the enabled state of IIZI.- Parameters:
isEnabled
- The enabled state.- Throws:
IllegalStateException
- If state is already set.
checkEnabledOrStarting
Call this function in e.g. wizards to check if IIZI is enabled.A dialog box showing that IIZI is not enabled or starting up.
- Parameters:
shell
- The shell.wizard
- The wizard.- Returns:
- 1 if enabled, 0 (zero) if disabled, -1 if starting up.
checkEnabledOrStarting
Call this function in e.g. wizards to check if IIZI is enabled.A dialog box showing that IIZI is not enabled or starting up will be shown, then the runnable is called. The runnable should close e.g. the wizard in question.
The runnable will be called in the SWT thread in the "next cycle".
- Parameters:
shell
- The shell.wizard
- The wizard.runnable
- Optional runnable to call. If non-null, the runnable must close the wizard.- Returns:
- 1 if enabled, 0 (zero) if disabled, -1 if starting up.
getRuntimeCreation
Gets the runtime creation builder.- Returns:
- The runtime builder instance, null if not yet set.
setRuntimeCreation
Sets the runtime creation builder. Do not call this method, it is used by the framework.- Parameters:
impl
- The runtime builder.
getCoreClasspathEntries
Gets the classpath entries for the IIZI Core.- Returns:
- The list of core class path entry URL's.
getPluginClasspathEntries
Gets the classpath entries for IIZI Plug-ins. These entries must also include the Server class entries.- Returns:
- The list of plugin class path entry URL's.
getUserPrivateDirectory
Gets the user's private directory, normally where the other directories are placed, such as the JDBC drivers "jdbc-drivers", the database "db", etc.- Returns:
- The User's private directory "~/.iizi" in canonical form, the directory is always present.
getJDBCDriversDir
Gets the JDBC drivers directory, a user local directory that always should exist.- Returns:
- The canonical form of the directory "~/.iizi/jdbc-drivers".
getDatabaseDirectoryCandidate
Gets the database directory candidate to use. This call also updates the default value "db_dir" in the Eclipse preference store, if not set.- Returns:
- The directory to use.
getDatabaseDirectory
Gets the database directory to use. The database directory is created if not present.- Returns:
- The directory to use.
- Throws:
IOException
- If the database directory failed to be created. In case of an exception, a SEVERE error is logged prior to returning from this method, so no additional logging is required.
addServerLaunchOptions
Adds required options for the server when launched from inside iiziGo.- Parameters:
args
- The list of server arguments.- Throws:
CoreException
- For errors.
getByteSize
Gets a size string in bytes.- Parameters:
size
- The size.- Returns:
- The string formatted as "#,##0 bytes".
openURL
Opens an URL in an external browser. If the browser cannot be opened, a message box is displayed. This method may be called from any thread.- Parameters:
shell
- The shell owner, null for none.url
- The URL to display.
start
Starts up the iiziGo plug-in bundle.If this method throws an exception, it is taken as an indication that plug-in initialization has failed; as a result, the plug-in will not be activated; moreover, the plug-in will be marked as disabled and ineligible for activation for the duration.
Note 1: This method is automatically invoked by the platform the first time any code in the plug-in is executed.
Note 2: This method is intended to perform simple initialization of the plug-in environment. The platform may terminate initializers that do not complete in a timely fashion.
Note 3: The class loader typically has monitors acquired during invocation of this method. It is strongly recommended that this method avoid synchronized blocks or other thread locking mechanisms, as this would lead to deadlock vulnerability.
Note 4: The supplied bundle context represents the plug-in to the OSGi framework. For security reasons, it is strongly recommended that this object should not be divulged.
Note 5: This method and the stop(BundleContext) may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.
- Specified by:
start
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
start
in classAbstractUIPlugin
- Parameters:
context
- The bundle context.- Throws:
Exception
- For errors in loading the IIZI properties framework.
isStopped
public static boolean isStopped()Checks if plugin is stopped or not started at all.stop
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
- Overrides:
stop
in classAbstractUIPlugin
- Throws:
Exception
getWorker
Gets the Worker.- Returns:
- The worker, never null.
- Throws:
IOException
- If the worker cannot be started.
createDesignerPropMgr
Creates a Property Manager for the Designer connection with JavaScript.- Returns:
- The newly created PropMgr instance using Server and JavaScript mappings.
createServerPropMgr
Creates a new Property Manager for a Server simulation.- Parameters:
hasJSClient
- Flag indicating it's a JavaScript client or not.- Returns:
- The Property Manager or null if instance failed (errors are logged already).
createNewServerPropertyFactory
Creates a new Server property factory.- Returns:
- The newly created property factory.
- Throws:
IOException
- For failures.
getServerPropertyFactory
Gets the Server property factory.- Returns:
- The server property factory, always the same instance once created.
registerRootProperty
Registers a root property container not being a Java or Module root, e.g. Terminal Sessions.- Parameters:
name
- The name.root
- The root instance.- Returns:
- true For success, false (with logged warning message) indicates name is already registered.
- Throws:
IllegalArgumentException
- If it's not a root property.
getRootProperty
Gets a root property from a registered name.- Parameters:
name
- The name.- Returns:
- The root property, or null if not registered.
unregisterRootProperty
Unregisters a root property container not being a Java or Module root, e.g. Terminal Sessions.- Parameters:
name
- The name.root
- The root instance.- Returns:
- true For success, false (with logged warning message) indicates name is not registered.
- Throws:
IllegalArgumentException
- If it's not a root property.
getStateLocationFile
Gets a file in the state location area.- Parameters:
fileName
- The file name, set to null to get the (parent) directory where state files are stored.- Returns:
- The file for the activator plugin, or null if not initialized or exiting.
getSomeShell
Gets a shell.- Returns:
- Some shell.
messageBoxAsync
Shows a message box asynchronously in the SWT Thread. If the call is from a non-SWT thread, a switch to the SWT thread is done.- Parameters:
title
- The title.msg
- The message.style
- The SWT style, icons, buttons, etc.
messageBox
Shows a message box. If the call is from a non-SWT thread, a switch to the SWT thread is done.- Parameters:
title
- The title.msg
- The message.style
- The SWT style, icons, buttons, etc.- Returns:
- The button selected.
messageBox
Shows a message box.- Parameters:
shell
- The shell (owner of message box).title
- The title.msg
- The message.style
- The SWT style, icons, buttons, etc.- Returns:
- The button selected.
threadMessageBox
Shows a message box from another thread.- Parameters:
msg
- The message.title
- The title.style
- The SWT style, icons, buttons, etc.- Returns:
- The button selected.
threadMessageBox
Shows a message box from another thread.- Parameters:
shell
- The shell or null for none.msg
- The message.title
- The title.style
- The SWT style, icons, buttons, etc.- Returns:
- The button selected.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
genericTitle
- The title, or null to use "Error".exception
- The core exception.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
genericTitle
- The title, or null to use "Error".errorMsg
- Error message.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
shell
- The shell, or null to get the topmost one.genericTitle
- The title, or null to use "Error".exception
- The core exception.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
genericTitle
- The title, or null to use "Error".status
- The status.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.- Parameters:
genericTitle
- The title, or null to use "Error".error
- The error message.exception
- The exception.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
shell
- The shell, or null to get the topmost one.genericTitle
- The title, or null to use "Error".error
- The error message.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
shell
- The shell, or null to get the topmost one.genericTitle
- The title, or null to use "Error".error
- The error message.exception
- The exception.
openError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
shell
- The shell, or null to get the topmost one.genericTitle
- The title, or null to use "Error".status
- The status.
openExceptionDetailsError
Opens an error dialog if necessary. Takes care of complex rules necessary for making the error dialog look nice.This call can be done from any thread, if not the SWT thread, it will "syncExec" to it.
- Parameters:
shell
- The shell, or null to get the topmost one.genericTitle
- The title, or null to use "Error".status
- The status.
errorMessageBox
Shows an error message box from any thread for an exception.- Parameters:
shell
- The shell to use, if null one will be found...title
- The title.msg
- The message.e
- The Core Exception.- Returns:
- The code of the button that was pressed that resulted in this dialog closing. This will be Dialog.OK if the OK button was pressed, or Dialog.CANCEL if this dialog's close window decoration or the ESC key was used.
statusMessageBox
Shows a message box from any thread.- Parameters:
shell
- The shell to use, if null one will be found...title
- The title.msg
- The message.status
- The IStatus message (also MultiStatus).- Returns:
- The code of the button that was pressed that resulted in this dialog closing. This will be Dialog.OK if the OK button was pressed, or Dialog.CANCEL if this dialog's close window decoration or the ESC key was used.
getInstance
Returns the shared instance.- Returns:
- The shared instance.
getProxy
Gets a Java Proxy instance for an URL.- Specified by:
getProxy
in interfaceIWebServiceEngine
- Parameters:
url
- The URL to get the proxy from.- Returns:
- The proxy to use.
configureProxy
Configures a Http(s)URLConnection for proxy information.- Specified by:
configureProxy
in interfaceIWebServiceEngine
- Parameters:
uc
- The HttpURLConnection or HttpsURLConnection.
loadPropertiesFile
Loads a properties file.- Parameters:
file
- The file.- Returns:
- The loaded property container.
- Throws:
PropException
- For property errors.IOException
- For I/O errors.
loadPropertiesFile
Loads a properties file.- Parameters:
url
- The URL.- Returns:
- The loaded property container.
- Throws:
PropException
- For property errors.IOException
- For I/O errors.
loadPropertiesFile
Loads a properties file.- Parameters:
file
- The file.- Returns:
- The loaded property container.
- Throws:
CoreException
- For file errors.
createInputData
Creates InputStream byte array data from a property container.- Parameters:
container
- The property container.- Returns:
- The byte array for the property container.
- Throws:
IOException
- For I/O errors.TransformerException
- For XML error.
createInputStream
public static InputStream createInputStream(PropCnr container) throws IOException, TransformerException Creates an InputStream from a property container.- Parameters:
container
- The property container.- Returns:
- The InputStream for the property container.
- Throws:
IOException
- For I/O errors.TransformerException
- For XML error.
savePropertiesFile
public static void savePropertiesFile(PropCnr container, IFile file, IProgressMonitor monitor) throws CoreException Saves a properties file. The IFile reference and the file modification stamp are saved in the property container.- Parameters:
container
- The property container.file
- The file.monitor
- The monitor.- Throws:
CoreException
- For Eclipse file system errors.
prepareFolder
Prepares a folder, i.e. makes sure it exists. If not it is created, recursively.- Parameters:
folder
- The folder to prepare.monitor
- The progress monitor.- Throws:
CoreException
- For folder creation errors.
getSelectedProject
Gets the currently selected project.- Returns:
- The project, or null if none is selected.
getSelectedProject
Gets the first selected project.- Parameters:
sel
- The structured selection, null for none.- Returns:
- The project, or null if none is selected.
getSelectedProjects
Gets all selected projects.- Parameters:
sel
- The structured selection, null for none.- Returns:
- The projects, or null if none is selected.
getProject
Attempts to get the project from an Object, first as an IProject, then a DesignerProp, then as an adapted IResource.- Parameters:
o
- The object.- Returns:
- The project, or
null
if not found.
getFirstSelectedProperty
Gets the first currently selected property.- Returns:
- The property, or null if none is selected.
getFirstSelectedProperty
Gets the first currently selected property.This method validates the properties and skips those that are disposed of in case the viewer selection is "old" and not refreshed.
- Parameters:
sel
- The structured selection, null for none.- Returns:
- The property, or null if none is selected.
getSelectedProps
Gets a list of all DesignerProp's in a selection that should be used in e.g. a Delete or Copy/Cut operation. If a property container is present in the selection, all its children are removed from the list, because they would be included in the container operation.This method validates the properties and skips those that are disposed of in case the viewer selection is "old" and not refreshed.
- Parameters:
sel
- The structured selection, null for none.- Returns:
- The list of selected properties.
getSelectedGProps
Gets a list of all GProp's for DesignerProp's in a selection that should be used in e.g. a Delete or Copy/Cut operation. If a property container is present in the selection, all its children are removed from the list, because they would be included in the container operation.- Parameters:
sel
- The selection.- Returns:
- The GProp array.
getGProps
Gets a list of all GProp's for the DesignerProp's list.- Parameters:
list
- List of designer properties.- Returns:
- The GProp array.
getSelectedRawGProps
Gets a list of all RAW GProp's without DesignerProp's in a selection that should be used in e.g. a Delete or Copy/Cut operation. If a property container is present in the selection, all its children are removed from the list, because they would be included in the container operation.- Parameters:
sel
- The selection.- Returns:
- The GProp array.
getPropCnrs
Gets a PropCnr's from a DesignerProp list.- Parameters:
list
- The list of DesignerProp's or null for none.- Returns:
- The returned array, never null.
isResourceBased
Checks if the property contains a resource.- Parameters:
gp
- The property.- Returns:
- true if the property is a FilePropCnr or FolderPropCnr with a resource.
areAllResourceBased
Checks if the properties only contains resources.- Parameters:
props
- The properties.- Returns:
- true if all properties are resource based, false otherwise.
fileToData
Converts the property to get the data container property instead of a FilePropCnr.- Parameters:
gp
- The input property.- Returns:
- The same as the input property for no change, the data container property if it was a FilePropCnr when possible (data container not null).
fileToData
Converts the property to get the data container property instead of a FilePropCnr.- Parameters:
dp
- The input property.- Returns:
- The same as the input property for no change, the data container property if it was a FilePropCnr when possible (data container not null).
fileToData
Converts the array of properties to get the data container property instead of a FilePropCnr.- Parameters:
props
- The input properties.- Returns:
- The same as the input array for no change, a new array without FilePropCnr when possible (data container not null).
dataToFile
Converts the property to get the FilePropCnr instead of the data container property.- Parameters:
gp
- The input propertY.- Returns:
- The property or its FilePropCnr when possible.
dataToFile
Converts the DesignerProp from the data container to the FilePropCnr one, if it refers to a file.- Parameters:
dp
- The Designer property instance of e.g. the data container.- Returns:
- The File Designer property if the parameter
dp
was a data container, otherwise the same value as thedp
parameter.
dataToFile
Converts the array of properties to get the FilePropCnr instead of the data container property.- Parameters:
props
- The input properties.- Returns:
- The same as the input array for no change, a new array with FilePropCnr when possible.
getSelectedResources
Returns the resource selection from the LocalSelectionTransfer.- Returns:
- The currently selected resources, never null.
getSelectedResources
Returns the resource selection.- Parameters:
selection
- Any selection of properties, resources, etc.- Returns:
- The resources from a selection, never null.
getSelectedResources
Returns the resource selection.- Parameters:
selection
- Any selection of properties, resources, etc.- Returns:
- The resources from a selection, never null.
getFirstSelectedFile
Gets the first selected file resource.- Parameters:
selection
- The selection.- Returns:
- The resource or null if none.
getClipboard
Gets the clip board instance for the plug-in. It will be disposed of when the plug-in stops.- Returns:
- The clipboard instance.
disposeClipboard
public static void disposeClipboard()Disposes of the clipboard.mergeStatus
Adds the given status to the list of problems. Discards OK statuses. If the status is a multi-status, only its children are added.- Parameters:
status
- The status to merge with.toMerge
- The status to merge, if it's OK to merge!
createErrorStatus
Creates an error status.- Parameters:
msg
- The message.- Returns:
- The status.
createErrorStatus
Creates an error status.- Parameters:
msg
- The message.e
- The exception.- Returns:
- The status.
createWarningStatus
Creates a warning status.- Parameters:
msg
- The message.- Returns:
- The status.
createInfoStatus
Creates an informational status.- Parameters:
msg
- The message.- Returns:
- The status.
refresh
Refreshes the workspace for the specified properties.- Parameters:
dps
- The collection of DesignerProp's to refresh.
centerDialog
Centers a dialog box Shell over it's parent shell on the same monitor as the parent shell. The right/bottom side will first attempt to be set visible, then the left/top side will be adjusted to fit at worst at the top/left of the monitor of the parent shell.- Parameters:
shell
- The dialog box shell.
getInternalWebServerUnsecurePort
public static int getInternalWebServerUnsecurePort()Returns the current HTTP port for the internal web server.- Returns:
- The port number, or zero if not started.
createKStringInfoProvider
public KStringInfoProviderAdapter createKStringInfoProvider(GProp<?> anyProp, boolean shouldResolve) Creates an IKStringInfoProvider for a property.- Parameters:
anyProp
- Property for reference resolving.shouldResolve
- Flag indicating the "real" resolved string should be returned. This value is true for the runtime client when in "real run mode".- Returns:
- A new KStringInfoProviderAdapter instance for the unsecure web server port if any.
getKStringInfoProvider
Retrieves the KStringInfoProvider.- Specified by:
getKStringInfoProvider
in interfaceIKStringInfoProviderHolder
- Returns:
- The KString information provider instance, or null if not possible.
getKStringInfoProvider
Retrieves the KStringInfoProvider.- Parameters:
anyProp
- Any property, ornull
to get it from the module root.- Returns:
- The KString information provider instance, or null if not possible.
getConfigurationPreferences
public static org.osgi.service.prefs.Preferences getConfigurationPreferences()Gets the iiziGo Configuration Preferences, not stored in the workspace, but with the Eclipse installation.You may create another node if you wish to separate it from the default iiziGo ones.
- Returns:
- The preferences.
getExecutorService
Gets the executor service.- Returns:
- The executor service instance tunes for this machine.