diff --git a/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h b/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h
index daab470ee7..7a2fbdbf4a 100644
--- a/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h
+++ b/Plugins/org.blueberry.core.commands/src/berryAbstractHandler.h
@@ -1,159 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTHANDLER_H_
#define BERRYABSTRACTHANDLER_H_
#include "berryIHandler.h"
#include "berryIHandlerListener.h"
#include
* This class is a partial implementation of
* Subclasses may extend the definition of this method (i.e., if a different
* type of listener can be attached to a subclass). This is used primarily
* for support of
* Returns true iff there is one or more IHandlerListeners attached to this
* AbstractHandler.
*
* Subclasses may extend the definition of this method (i.e., if a different
* type of listener can be attached to a subclass). This is used primarily
* for support of
* A command is an abstract representation for some semantic behaviour. It is
* not the actual implementation of this behaviour, nor is it the visual
* appearance of this behaviour in the user interface. Instead, it is a bridge
* between the two.
*
* The concept of a command is based on the command design pattern. The notable
* difference is how the command delegates responsibility for execution. Rather
* than allowing concrete subclasses, it uses a handler mechanism (see the
*
* A command will exist in two states: defined and undefined. A command is
* defined if it is declared in the XML of a resolved plug-in. If the plug-in is
* unloaded or the command is simply not declared, then it is undefined. Trying
* to reference an undefined command will succeed, but trying to access any of
* its functionality will fail with a
* Commands are mutable and will change as their definition changes.
*
* Adds a state to this command. This will add this state to the active
* handler, if the active handler is an instance of {@link IObjectWithState}.
*
* A single instance of {@link State} cannot be registered with multiple
* commands. Each command requires its own unique instance.
*
* Defines this command by giving it a name, and possibly a description as
* well. The defined property automatically becomes
* Notification is sent to all listeners that something has changed.
*
* This value can change at any time and should never be cached.
*
* Removes a state from this command. This will remove the state from the
* active handler, if the active handler is an instance of
* {@link IObjectWithState}.
*
* A central repository for commands -- both in the defined and undefined
* states. Commands can be created and retrieved using this manager. It is
* possible to listen to changes in the collection of commands by attaching a
* listener to the manager.
*
* Returns a {@link ParameterizedCommand} with a command and
* parameterizations as specified in the provided
*
* If a parameter id encoded in the
*
* This method will never return
* Note: This supports bridging actions to the command framework,
* and should not be used outside the framework.
*
* Note: This supports bridging actions to the command framework,
* and should not be used outside the framework.
*
* Note: This supports bridging actions to the command framework,
* and should not be used outside the framework.
*
* Note: This supports bridging actions to the command framework,
* and should not be used outside the framework.
*
* Note: This supports bridging actions to the command framework,
* and should not be used outside the framework.
*
* See also ParameterizedCommand.escape(String)
*
* The data object to pass to the command (and its handler) as it executes. This
* carries information about the current state of the application, and the
* application context in which the command was executed.
*
* An execution event carries three blocks of data: the parameters, the trigger,
* and the application context. How these blocks are used is application
* dependent. In the BlueBerry workbench, the trigger is an SWT event, and the
* application context contains information about the selection and active part.
*
* This is intended to be used in the scope of an
- * {@link IHandler#execute(ExecutionEvent)} method, so any problem getting
+ * {@link IHandler#Execute} method, so any problem getting
* the object value causes
* Clients may instantiate this default context. The class is
* not intended to be subclassed by clients.
*
* In addition the class implements the three operation
* The and operation:
*
* The or operation:
*
* The not operation:
*
* The class is not intended to be subclassed by clients.
*
- * An expression is evaluated by calling {@link #evaluate(IEvaluationContext)}.
+ * An expression is evaluated by calling {@link #Evaluate}.
*
* This class may be subclassed to provide specific expressions.
*
* This default implementation calls
* This is a convenience method for collecting the expression information
- * using {@link Expression#collectExpressionInfo(ExpressionInfo)}.
+ * using {@link Expression#CollectExpressionInfo}.
*
* An expression converter manages a list of {@link ElementHandler}s. Element
* handlers are responsible to do the actual conversion. The element handlers
* build a chain of responsibility.
*
* This class is not intended to be extended by clients.
*
* This interface is not intended to be implemented by clients. Clients
* are allowed to instantiate
* A single job listener instance can be added either to the job manager, for notification
* of all scheduled jobs, or to any set of individual jobs. A single listener instance should
* not be added to both the job manager, and to individual jobs (such a listener may
* receive duplicate notifications).
*
* Clients should not rely on the result of the
* Clients may implement this interface.
*
- // * Rules can be nested only if the rule for the inner beginRule
- // * is contained within the rule for the outer beginRule. Rule containment
- // * is tested with the API method ISchedulingRule.contains. Also, begin/end
- // * pairs must be strictly nested. Only the rule that has most recently begun
- // * can be ended at any given time.
- // *
- // * A rule of
- // * If this method is called from within a job that has a scheduling rule, the
- // * given rule must also be contained within the rule for the running job.
- // *
- // * Note that endRule must be called even if beginRule fails.
- // * The recommended usage is:
- // *
* Recommended usage (this snippet runs two jobs in sequence in a
* single progress group):
- *
- // * Rules can be nested only if the rule for the inner beginRule
- // * is contained within the rule for the outer beginRule. Also, begin/end
- // * pairs must be strictly nested. Only the rule that has most recently begun
- // * can be ended at any given time.
- // *
- // * @param rule the rule to end applying in this thread
- // * @throws IllegalArgumentException if this method is called on a rule for which
- // * there is no matching begin, or that does not match the most recent begin.
- // * @see ISchedulingRule#contains(ISchedulingRule)
- // */
- /// virtual void EndRule(const ISchedulingRule& rule) = 0;
-
- ///**
- // * Returns all waiting, executing and sleeping jobs belonging
- // * to the given family. If no jobs are found, an empty array is returned.
- // *
- // * @param family the job family to find, or
- // * If this method is called while the job manager is suspended, only jobs
- // * that are currently running will be joined; Once there are no jobs
- // * in the family in the {@link Job#RUNNING} state, this method returns.
- // *
- // * Note that there is a deadlock risk when using join. If the calling thread owns
- // * a lock or object monitor that the joined thread is waiting for, deadlock
- // * will occur. This method can also result in starvation of the current thread if
- // * another thread continues to add jobs of the given family, or if a
- // * job in the given family reschedules itself in an infinite loop.
- // *
- // * Calling this method on a rule that is not suspended has no effect. If another
- // * thread also owns the rule at the time this method is called, then the rule will
- // * not be resumed until all threads have released the rule.
- // *
- // * @deprecated This method is not safe and should not be used.
- // * Suspending a scheduling rule violates the thread safety
- // * of clients that use scheduling rules as a mutual exclusion mechanism,
- // * and can result in concurrency problems in all clients that use the suspended rule.
- // * @see #suspend(ISchedulingRule, IProgressMonitor)
- // */
- /// virtual void Resume(const ISchedulingRule& rule) = 0;
-
- ///**
- // * Resumes execution of jobs after a previous
- // * Calling
- // * This method is for internal use by the platform-related plug-ins.
- // * Clients should not call this method.
- // *
* This method is intended for use by the currently executing Eclipse application.
* Plug-ins outside the currently running application should not call this method.
*
- * The job manager will remain suspended until a subsequent call to
- *
- * All attempts to join sleeping and waiting jobs while the job manager is
- * suspended will return immediately.
- *
- * Note that this very powerful function should be used with extreme caution.
- * Suspending the job manager will prevent all jobs in the system from executing,
- * which may have adverse affects on components that are relying on
- * execution of jobs. The job manager should never be suspended without intent
- * to resume execution soon afterwards.
- *
- * @see #resume()
- * @see #join(Object, IProgressMonitor)
- * @see #isSuspended()
- */
- // virtual void Suspend() = 0;
-
- ///**
- // * Defers execution of all jobs with scheduling rules that conflict with the
- // * given rule. The caller will be blocked until all currently executing jobs with
- // * conflicting rules are completed. Conflicting jobs that are sleeping or waiting at
- // * the time this method is called will not be executed until the rule is resumed.
- // *
- // * While a rule is suspended, all calls to
- // * This method is long-running; progress and cancelation are provided by
- // * the given progress monitor. In the case of cancelation, the rule will
- // * not be suspended.
- // *
- // * Sleeping jobs can be resumed using
- // * Calling this method is equivalent to atomically calling
- // * This method has no effect when the destination thread is the same as the
- // * calling thread.
- // *
- // * @param rule The scheduling rule to transfer
- // * @param destinationThread The new owner for the transferred rule.
- // * @since 3.1
- // */
- /// virtual void TransferRule(const ISchedulingRule& rule, Poco::Thread* destinationThread) = 0;
-
- ///**
- // * Resumes scheduling of all sleeping jobs in the given family. This method
- // * has no effect on jobs in the family that are not currently sleeping.
- // *
- // * @param family the job family to wake up, or
* Clients may implement this interface.
*
*
* Applications can return any object they like. If an
* Note: This method is called by the platform; it is not intended
* to be called directly by clients.
*
*
* This method is only called to force an application to exit.
* This method will not be called if an application exits normally from
- * the {@link #start()} method.
+ * the {@link #Start} method.
*
* Note: This method is called by the platform; it is not intended
* to be called directly by clients.
*
* This interface is not intended to be implemented by clients.
*
*
* If the properties used to launch an application do
* not contain a value for this key then command line arguments used to launch
* the platform are set in the arguments of the application context.
*/
static const QString APPLICATION_ARGS; // = "application.args";
/**
* A key used to store unprocessed arguments for the application.
* This is a
*
* If the properties used to launch an application do
* not contain a value for this key then command line arguments used to launch
* the platform are set in the unprocessed arguments of the application context.
*/
static const QString APPLICATION_ARGS_UNPROCESSED; // = "application.args.unprocessed";
/**
* The arguments used for the application. The arguments from
* QObject::dynamicPropertyNames() of a QObject service object registered under
* the interface "org.blueberry.core.runtime.AppDescriptor" are used as the arguments
* for this context when an application is launched.
*
* @return a map of application arguments.
*/
virtual QHash
* This class can not be extended or instantiated by clients.
* The method may return null if the contributor is not based on a plugin,
* if the plugin can't be found, or if the plugin is presently unresolved or
* uninstalled.
* This interface can be used without OSGi running.
*
* Clients may implement this interface.
*
* This method is generally used by an adapter manager
* to discover which adapter types are supported, in advance
* of dispatching any actual
* Adapter factories can be registered programmatically using the
* The following code snippet shows how one might register an adapter of type
*
*
- *
* This interface can be used without OSGi running.
*
* This interface is not intended to be implemented by clients.
*
* Note that this method will never cause plug-ins to be loaded. If the
* only suitable factory is not yet loaded, this method will return an empty Poco::Any.
* If activation of the plug-in providing the factory is required, use the
*
* Note that this method will never cause plug-ins to be loaded. If the
* only suitable factory is not yet loaded, this method will return
* Note that a return value of
* One of the following values can be returned:
* Note that unlike the
* This interface is not intended to be implemented by clients.
* Note that any translation specified in the plug-in manifest
* file is automatically applied.
*
* The names of configuration element attributes
* are the same as the attribute names of the corresponding XML element.
* For example, the configuration markup
*
* Each child corresponds to a nested
* XML element in the configuration markup.
* For example, the configuration markup
- * Values may span multiple lines (i.e., contain carriage returns
* and/or line feeds).
* Note that any translation specified in the plug-in manifest
* file is automatically applied.
*
* The locale matching tries to find the best match between available translations and
* the requested locale, falling back to a more generic locale ("en") when the specific
* locale ("en_US") is not available.
*
* If multi-language support is not enabled, this method is equivalent to the method
- * {@link #getValue()}.
+ * {@link #GetValue()}.
*
* Registry contributor objects can be obtained by calling {@link IExtensionPoint#GetContributor()},
* {@link IExtension#GetContributor()}, and {@link IConfigurationElement#GetContributor()}.
* Alternatively, a contributor factory appropriate for the registry in use can be called to directly
* obtain an IContributor object.
*
* This interface is not intended to be implemented or extended by clients.
*
* These registry objects are intended for relatively short-term use. Clients that
* deal with these objects must be aware that they may become invalid if the
* declaring plug-in is updated or uninstalled. If this happens, all methods except
* {@link #IsValid()} will throw {@link InvalidRegistryObjectException}.
* For extension objects, the most common case is code in a plug-in dealing
* with extensions contributed to one of the extension points it declares.
* Code in a plug-in that has declared that it is not dynamic aware (or not
* declared anything) can safely ignore this issue, since the registry
* would not be modified while it is active. However, code in a plug-in that
* declares that it is dynamic aware must be careful when accessing the extension
* objects because they become invalid if the contributing plug-in is removed.
* Similarly, tools that analyze or display the extension registry are vulnerable.
* Client code can pre-test for invalid objects by calling {@link #IsValid()},
* which never throws this exception. However, pre-tests are usually not sufficient
* because of the possibility of the extension object becoming invalid as a
* result of a concurrent activity. At-risk clients must treat
*
* This interface is not intended to be implemented by clients.
* Note that any translation specified in the extension manifest
* file is automatically applied.
*
*
* @return a displayable string label for this extension,
* possibly the empty string
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetLabel() const = 0;
/**
* Returns the simple identifier of this extension, or
* These registry objects are intended for relatively short-term use. Clients that
* deal with these objects must be aware that they may become invalid if the
* declaring plug-in is updated or uninstalled. If this happens, all methods except
- * {@link #isValid()} will throw {@link InvalidRegistryObjectException}.
+ * {@link #IsValid()} will throw {@link InvalidRegistryObjectException}.
* For extension point objects, the most common case is code in a plug-in dealing
* with one of the extension points it declares. These extension point objects are
* guaranteed to be valid while the plug-in is active. Code in a plug-in that has
* declared that it is not dynamic aware (or not declared anything) can also safely
* ignore this issue, since the registry would not be modified while it is
* active. However, code in a plug-in that declares that it is dynamic aware
* must be careful if it access the extension point object of a different plug-in,
* because it's at risk if that other plug-in is removed. Similarly,
* tools that analyze or display the extension registry are vulnerable.
- * Client code can pre-test for invalid objects by calling {@link #isValid()},
+ * Client code can pre-test for invalid objects by calling {@link #IsValid()},
* which never throws this exception. However, pre-tests are usually not sufficient
* because of the possibility of the extension point object becoming invalid as a
* result of a concurrent activity. At-risk clients must treat
*
* This interface is not intended to be implemented by clients.
* Note that any translation specified in the plug-in manifest
* file is automatically applied.
*
* The extension registry can be queried, by name, for
* extension points and extensions.
*
* The various objects that describe the contents of the extension registry
* ({@link IExtensionPoint}, {@link IExtension}, and {@link IConfigurationElement})
* are intended for relatively short-term use. Clients that deal with these objects
* must be aware that they may become invalid if the declaring plug-in is updated
* or uninstalled. If this happens, all methods on these object except
- *
* Extensions and extension points are declared by generic entities called
- * namespaces. The only fact known about namespaces is that they
+ * \c namespaces . The only fact known about namespaces is that they
* have unique string-based identifiers. One example of a namespace
* is a plug-in, for which the namespace id is the plug-in id.
*
* This interface is not intended to be implemented by clients.
*
* The fully-qualified name of an extension point or an extension consist of
* a namespace and a simple name (much like a qualified Java class name consist
* of a package name and a class name). The simple names are presumed to be unique
* in the namespace.
*
* This method is an access controlled method. Proper token (master token or user token) should
- * be passed as an argument. Two registry keys are set in the registry constructor
- * {@link RegistryFactory#CreateRegistry(RegistryStrategy*, QObject*, QObject*)}:
+ * be passed as an argument. Two registry keys are set in the registry constructor:
* master token and a user token. Master token allows all operations; user token allows
* non-persisted registry elements to be modified.
*
* This method is an access controlled method. Proper token (master token or user token) should
- * be passed as an argument. Two registry keys are set in the registry constructor
- * {@link RegistryFactory#CreateRegistry(RegistryStrategy*, QObject*, QObject*)}:
+ * be passed as an argument. Two registry keys are set in the registry constructor:
* master token and a user token. Master token allows all operations; user token only
* allows non-persisted registry elements to be modified.
*
* This method is an access controlled method. Proper token (master token or user token) should
- * be passed as an argument. Two registry keys are set in the registry constructor
- * {@link RegistryFactory#CreateRegistry(RegistryStrategy*, QObject*, QObject*)}:
+ * be passed as an argument. Two registry keys are set in the registry constructor:
* master token and a user token. Master token allows all operations; user token only
* allows non-persisted registry elements to be modified.
*
* This method is an access controlled method. Master token should be passed as an argument.
*
* Depending on activity, listeners of this type might receive a large number
* of modifications and negatively impact overall system performance. Whenever
* possible, consider registering listener specific to an extension point rather
* than a "global" listener.
*
* Once registered, a listener starts receiving notification of changes to
* the registry. Registry change notifications are sent asynchronously.
* The listener continues to receive notifications until it is removed.
*
* This method has no effect if the listener is already registered.
*
* Depending on activity, listeners of this type might receive a large number
* of modifications and negatively impact overall system performance. Whenever
* possible, consider registering listener specific to an extension point rather
* than a "global" listener.
*
* Once registered, a listener starts receiving notification of changes to
* the registry. Registry change notifications are sent asynchronously.
* The listener continues to receive notifications until it is removed.
*
* This method has no effect if the listener is already registered.
*
* This method has no effect if the listener is not registered.
*
* See the runtime option "-registryMultiLanguage" for enabling multi-language
* support.
*
*
*
* Only the abstract methods may be implemented.
*
* This method is not meant to be called by clients. It will be called by
* the menu service at the appropriate time.
*
* Note: This constructor should not be called outside the framework.
*
* This class maintains a list of contribution items and a dirty flag, both as
* internal state. In addition to providing implementations of most
*
* Note: A
* This class may be instantiated; it is not intended to be
* subclassed outside the framework.
*
* A contribution item can realize itself in different Qt widgets, using the different
* IHandler
. This
* abstract implementation provides support for handler listeners. You should
* subclass from this class unless you want to implement your own listener
* support. Subclasses should call
- * {@link AbstractHandler#fireHandlerChanged(HandlerEvent)}when the handler
- * changes. Subclasses can also override {@link AbstractHandler#isEnabled()} and
- * {@link AbstractHandler#isHandled()}.
+ * {@link AbstractHandler#FireHandlerChanged} when the handler
+ * changes. Subclasses can also override {@link AbstractHandler#IsEnabled} and
+ * {@link AbstractHandler#IsHandled}.
* true
- * @see #setEnabled(Object)
- * @see #setBaseEnabled(boolean)
+ * @see #SetEnabled
+ * @see #SetBaseEnabled
*/
bool IsEnabled() const override;
/**
* Called by the framework to allow the handler to update its enabled state
* by extracting the same information available at execution time. Clients
* may override if they need to extract information from the application
* context.
*
* @param evaluationContext
* the application context. May be null
* @see #SetBaseEnabled(bool)
*/
void SetEnabled(const Object::Pointer& evaluationContext) override;
/**
* Whether this handler is capable of handling delegated responsibilities at
* this time. Subclasses may override this method.
*
* @return true
*/
bool IsHandled() const override;
/**
* @see IHandler#removeHandlerListener(IHandlerListener)
*/
void RemoveHandlerListener(IHandlerListener* handlerListener) override;
protected:
/**
* Fires an event to all registered listeners describing changes to this
* instance.
* AbstractHandler
in
* org.blueberry.ui.workbench
, and clients should be wary of
* overriding this behaviour. If this method is overridden, then the first
* line of the method should be "super.fireHandlerChanged(handlerEvent);
".
* null
.
*/
void FireHandlerChanged(const SmartPointerAbstractHandler
in
* org.blueberry.ui.qt
, and clients should be wary of
* overriding this behaviour. If this method is overridden, then the return
* value should include "super.hasListeners() ||
".
* handlers
extension point). This provides another level of
* indirection.
* NotDefinedException
. If
* you need to know when a command changes from defined to undefined (or vice
* versa), then attach a command listener.
* true
if commands should print
* information to System.out
when executing.
*/
static bool DEBUG_COMMAND_EXECUTION;
/**
* This flag can be set to true
if commands should print
* information to System.out
when changing handlers.
*/
static bool DEBUG_HANDLERS;
/**
* This flag can be set to a particular command identifier if only that
* command should print information to System.out
when
* changing handlers.
*/
static QString DEBUG_HANDLERS_COMMAND_ID;
private:
/**
* The category to which this command belongs. This value should not be
* null
unless the command is undefined.
*/
SmartPointernull
if there is no handler currently.
*/
SmartPointernull
if there is no help currently associated with the
* command.
*/
QString helpContextId;
/**
* The ordered array of parameters understood by this command. This value
* may be null
if there are no parameters, or if the command
* is undefined. It may also be empty.
*/
QListnull
if the command does not declare a return type.
*/
SmartPointerCommand
based on the given
* identifier. When a command is first constructed, it is undefined.
* Commands should only be constructed by the CommandManager
* to ensure that the identifier remains unique.
*
* @param id
* The identifier for the command. This value must not be
* null
, and must be unique amongst all commands.
*/
Command(const QString& id);
friend class CommandManager;
public:
/**
* Adds a listener to this command that will be notified when this command's
* state changes.
*
* @param commandListener
* The listener to be added; must not be null
.
*/
void AddCommandListener(ICommandListener* commandListener);
/**
* Adds a listener to this command that will be notified when this command
* is about to execute.
*
* @param executionListener
* The listener to be added; must not be null
.
*/
void AddExecutionListener(IExecutionListener* executionListener);
/**
* null
.
* @param state
* The state to add; must not be null
.
*/
void AddState(const QString& id, const SmartPointerCommand
.
* @return false if the object is
* equal to or greater than this command.
*/
bool operator<(const Object* object) const override;
/**
* true
.
* null
.
* @param description
* The description for this command; may be null
.
* @param category
* The category for this command; must not be null
.
* @param parameters
* The parameters understood by this command. This value may be
* either null
or empty if the command does not
* accept parameters.
* @param returnType
* The type of value returned by this command. This value may be
* null
if the command does not declare a return
* type.
* @param helpContextId
* The identifier of the help context to associate with this
* command; may be null
if this command does not
* have any help associated with it.
*/
void Define(const QString& name, const QString& description,
const SmartPointernull
.
* @return The result of the execution; may be null
. This
* result will be available to the client executing the command, and
* execution listeners.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
*/
Object::Pointer ExecuteWithChecks(const SmartPointernull
.
*/
void FireCommandChanged(const SmartPointernull
.
* @since 3.2
*/
void FireNotDefined(const NotDefinedException* e);
/**
* Notifies the execution listeners for this command that an attempt to
* execute has failed because there is no handler.
*
* @param e
* The exception that is about to be thrown; never
* null
.
*/
void FireNotEnabled(const NotEnabledException* e);
/**
* Notifies the execution listeners for this command that an attempt to
* execute has failed because there is no handler.
*
* @param e
* The exception that is about to be thrown; never
* null
.
*/
void FireNotHandled(const NotHandledException* e);
/**
* Notifies the execution listeners for this command that an attempt to
* execute has failed during the execution.
*
* @param e
* The exception that has been thrown; never null
.
* After this method completes, the exception will be thrown
* again.
*/
void FirePostExecuteFailure(const ExecutionException* e);
/**
* Notifies the execution listeners for this command that an execution has
* completed successfully.
*
* @param returnValue
* The return value from the command; may be null
.
*/
void FirePostExecuteSuccess(const Object::Pointer returnValue);
/**
* Notifies the execution listeners for this command that an attempt to
* execute is about to start.
*
* @param event
* The execution event that will be used; never null
.
*/
void FirePreExecute(const SmartPointernull
.
*/
SmartPointernull
if there is none.
*/
QString GetHelpContextId() const;
/**
* Returns the parameter with the provided id or null
if this
* command does not have a parameter with the id.
*
* @param parameterId
* The id of the parameter to retrieve.
* @return The parameter with the provided id or null
if this
* command does not have a parameter with the id.
* @throws NotDefinedException
* If the handle is not currently defined.
*/
SmartPointernull
, if the command has no parameters.
* @throws NotDefinedException
* If the handle is not currently defined.
*/
QListnull
if this command does not have a parameter type
* with the id.
*
* @param parameterId
* The id of the parameter to retrieve the {@link ParameterType}
* of.
* @return The {@link ParameterType} for the parameter with the provided id
* or null
if this command does not have a parameter
* type with the provided id.
* @throws NotDefinedException
* If the handle is not currently defined.
*/
SmartPointernull
if this command does not declare a return value
* parameter type.
*
* @return The {@link ParameterType} for the return value of this command or
* null
if this command does not declare a return
* value parameter type.
* @throws NotDefinedException
* If the handle is not currently defined.
*/
SmartPointertrue
if the command is handled; false
* otherwise.
*/
bool IsEnabled() const;
/**
* Called be the framework to allow the handler to update its enabled state.
*
* @param evaluationContext
* the state to evaluate against. May be null
* which indicates that the handler can query whatever model that
* is necessary. This context must not be cached.
*/
void SetEnabled(const Object::Pointer& evaluationContext);
/**
* Returns whether this command has a handler, and whether this handler is
* also handled.
*
* @return true
if the command is handled; false
* otherwise.
*/
bool IsHandled() const;
/**
* Removes a listener from this command.
*
* @param commandListener
* The listener to be removed; must not be null
.
*
*/
void RemoveCommandListener(ICommandListener* commandListener);
/**
* Removes a listener from this command.
*
* @param executionListener
* The listener to be removed; must not be null
.
*
*/
void RemoveExecutionListener(IExecutionListener* executionListener);
/**
* null
.
*/
void RemoveState(const QString& stateId) override;
/**
* Changes the handler for this command. This will remove all the state from
* the currently active handler (if any), and add it to handler
.
* If debugging is turned on, then this will also print information about
* the change to System.out
.
*
* @param handler
* The new handler; may be null
if none.
* @return true
if the handler changed; false
* otherwise.
*/
bool SetHandler(const SmartPointernull
.
*/
QString ToString() const override;
/**
* Makes this command become undefined. This has the side effect of changing
* the name and description to null
. This also removes all
* state and disposes of it. Notification is sent to all listeners.
*/
void Undefine() override;
};
}
#endif /*BERRYCOMMAND_H_*/
diff --git a/Plugins/org.blueberry.core.commands/src/berryCommandManager.h b/Plugins/org.blueberry.core.commands/src/berryCommandManager.h
index 4cc307186f..e01dae7312 100755
--- a/Plugins/org.blueberry.core.commands/src/berryCommandManager.h
+++ b/Plugins/org.blueberry.core.commands/src/berryCommandManager.h
@@ -1,628 +1,628 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCOMMANDMANAGER_H_
#define BERRYCOMMANDMANAGER_H_
#include "common/berryHandleObjectManager.h"
#include "berryIExecutionListenerWithChecks.h"
#include "berryICommandListener.h"
#include "berryIParameterTypeListener.h"
#include "berryICommandCategoryListener.h"
#include "berryICommandManagerListener.h"
#include null
.
*/
static const QString AUTOGENERATED_CATEGORY_ID; // = "org.blueberry.core.commands.categories.autogenerated";
/**
* The default constructor
*/
CommandManager();
/**
* Adds a listener to this command manager. The listener will be notified
* when the set of defined commands changes. This can be used to track the
* global appearance and disappearance of commands.
*
* @param listener
* The listener to attach; must not be null
.
*/
void AddCommandManagerListener(ICommandManagerListener* listener);
/**
* Adds an execution listener to this manager. This listener will be
* notified if any of the commands controlled by this manager execute. This
* can be used to support macros and instrumentation of commands.
*
* @param listener
* The listener to attach; must not be null
.
*/
void AddExecutionListener(IExecutionListener* listener);
/**
* Sets the name and description of the category for uncategorized commands.
* This is the category that will be returned if
- * {@link #getCategory(String)} is called with null
.
+ * {@link #GetCategory} is called with null
.
*
* @param name
* The name of the category for uncategorized commands; must not
* be null
.
* @param description
* The description of the category for uncategorized commands;
* may be null
.
*/
void DefineUncategorizedCategory(const QString& name,
const QString& description);
/**
* serializedParameterizedCommand
string. The
* serializedParameterizedCommand
must use the format
- * returned by {@link ParameterizedCommand#serialize()} and described in the
+ * returned by {@link ParameterizedCommand#Serialize} and described in the
* Javadoc for that method.
* serializedParameterizedCommand
does not exist in the
* encoded command, that parameter id and value are ignored. A given
* parameter id should not be used more than once in
* serializedParameterizedCommand
. This will not result in
* an exception, but in this case the value of the parameter when the
* command is executed is unspecified.
* null
, however it may throw
* an exception if there is a problem processing the serialization string or
* the encoded command is undefined.
* null
* @return a {@link ParameterizedCommand} with the command and
* parameterizations encoded in the
* serializedParameterizedCommand
; never
* null
.
* @throws NotDefinedException
* if the command indicated in
* serializedParameterizedCommand
is not defined
* @throws SerializationException
* if there is an error deserializing
* serializedParameterizedCommand
* @see ParameterizedCommand#serialize()
*/
SmartPointernull
.
*/
QListnull
. If
* the category is null
, then a category suitable
* for uncategorized items is defined and returned.
* @return The category with the given identifier; this value will never be
* null
, but it might be undefined.
* @see Category
*/
SmartPointernull
and
* must not be zero-length.
* @return The command with the given identifier; this value will never be
* null
, but it might be undefined.
* @see Command
*/
SmartPointernull
.
*/
QListnull
.
*/
QSetnull
.
*/
QSetnull
.
*/
QListnull
.
*/
QSetnull
.
*/
QListnull
is returned.
*
* @param command
* The command for which the help context should be retrieved;
* must not be null
.
* @return The help context identifier to use for the given command; may be
* null
.
* @throws NotDefinedException
* If the given command is not defined.
*/
QString GetHelpContextId(const SmartPointernull
and
* must not be zero-length.
* @return The {@link ParameterType} with the given identifier; this value
* will never be null
, but it might be undefined.
*/
SmartPointernull
.
*/
void RemoveCommandManagerListener(ICommandManagerListener* listener);
/**
* Removes an execution listener from this command manager.
*
* @param listener
* The listener to be removed; must not be null
.
*/
void RemoveExecutionListener(IExecutionListener* listener);
/**
* Block updates all of the handlers for all of the commands. If the handler
* is null
or the command id does not exist in the map, then
* the command becomes unhandled. Otherwise, the handler is set to the
* corresponding value in the map.
*
* @param handlersByCommandId
* A map of command identifiers (String
) to
* handlers (IHandler
). This map may be
* null
if all handlers should be cleared.
* Similarly, if the map is empty, then all commands will become
* unhandled.
*/
void SetHandlersByCommandId(
const QHashnull
.
* @param helpContextId
* The help context identifier to register; may be
* null
if the help context identifier should be
* removed.
*/
void SetHelpContextId(const SmartPointernotEnabled
event for
* executionListeners
.
* null
.
* @param exception
* The exception, never null
.
*/
void FireNotEnabled(const QString& commandId,
const NotEnabledException* exception);
/**
* Fires the notDefined
event for
* executionListeners
.
* null
.
* @param exception
* The exception, never null
.
*/
void FireNotDefined(const QString& commandId,
const NotDefinedException* exception);
/**
* Fires the preExecute
event for
* executionListeners
.
* null
.
* @param event
* The event that triggered the command, may be null
.
*/
void FirePreExecute(const QString& commandId, const SmartPointer<
const ExecutionEvent> event);
/**
* Fires the postExecuteSuccess
event for
* executionListeners
.
* null
.
* @param returnValue
* The value returned from the command, may be null
.
*/
void FirePostExecuteSuccess(const QString& commandId,
Object::Pointer returnValue);
/**
* Fires the postExecuteFailure
event for
* executionListeners
.
* null
.
* @param exception
* The exception, never null
.
*/
void FirePostExecuteFailure(const QString& commandId,
const ExecutionException* exception);
protected:
/**
* The escape character to use for serialization and deserialization of
* parameterized commands.
*/
static const char ESCAPE_CHAR; // = '%';
/**
* The character that separates a parameter id from its value.
*/
static const char ID_VALUE_CHAR; // = '=';
/**
* The character that indicates the end of a list of parameters.
*/
static const char PARAMETER_END_CHAR; // = ')';
/**
* The character that separators parameters from each other.
*/
static const char PARAMETER_SEPARATOR_CHAR; // = ',';
/**
* The character that indicates the start of a list of parameters.
*/
static const char PARAMETER_START_CHAR; // = '(';
friend class ParameterizedCommand;
private:
/**
* Unescapes special characters in the command id, parameter ids and
* parameter values for {@link #deserialize(String)}. The special characters
* {@link #PARAMETER_START_CHAR}, {@link #PARAMETER_END_CHAR},
* {@link #ID_VALUE_CHAR}, {@link #PARAMETER_SEPARATOR_CHAR} and
* {@link #ESCAPE_CHAR} are escaped by prepending an {@link #ESCAPE_CHAR}
* character.
* String
that may contain escaped special
* characters for command serialization.
* @return a String
representing escapedText
* with any escaped characters replaced by their literal values
* @throws SerializationException
* if escapedText
contains an invalid escape
* sequence
*/
static QString Unescape(const QString& escapedText);
/**
* The map of category identifiers (String
) to categories (
* Category
). This collection may be empty, but it is never
* null
.
*/
QHashnull
.
*/
QSetnull
.
*
*/
QSetnull
if there are no listeners.
*/
IExecutionListenerWithChecks::Events executionEvents;
/**
*
*/
ICommandManagerListener::Events commandManagerEvents;
/**
* The help context identifiers ({@link String}) for a handler ({@link IHandler}).
* This map may be empty, but it is never null
. Entries are
* removed if all strong references to the handler are removed.
*/
QHashString
) to
* parameter types ( ParameterType
). This collection may be
* empty, but it is never null
.
*/
QHashnull
.
*/
void FireCommandManagerChanged(
const SmartPointerserializedParameters
string.
*
* @param serializedParameters
* a String encoding parameter ids and values; must not be
* null
.
* @param parameters
* array of parameters of the command being deserialized; may be
* null
.
* @return an array of parameterizations; may be null
.
* @throws SerializationException
* if there is an error deserializing the parameters
*/
QListchar
in a String
* but disregards characters prefixed with the {@link #ESCAPE_CHAR} escape
* character. This is used by {@link #deserialize(String)} and
* {@link #getParameterizations(String, IParameter[])} to parse the
* serialized parameterized command string.
*
* @param escapedText
* the string to search for the index of ch
in
* @param ch
* a character to search for in escapedText
* @return the index of the first unescaped occurrence of the character in
* escapedText
, or -1
if the
* character does not occur unescaped.
* @see String#indexOf(int)
*/
int UnescapedIndexOf(const QString& escapedText, const char ch) const;
};
}
#endif /* BERRYCOMMANDMANAGER_H_ */
diff --git a/Plugins/org.blueberry.core.commands/src/berryExecutionEvent.h b/Plugins/org.blueberry.core.commands/src/berryExecutionEvent.h
index d6871926b5..5b1a00cf29 100644
--- a/Plugins/org.blueberry.core.commands/src/berryExecutionEvent.h
+++ b/Plugins/org.blueberry.core.commands/src/berryExecutionEvent.h
@@ -1,169 +1,169 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXECUTIONEVENT_H_
#define BERRYEXECUTIONEVENT_H_
#include null
.
*/
const Object::Pointer applicationContext;
/**
* The command being executed. This value may be null
.
*/
const Command::ConstPointer command;
/**
* The parameters to qualify the execution. For handlers that normally
* prompt for additional information, these can be used to avoid prompting.
* This value may be empty, but it is never null
.
*/
const ParameterMap parameters;
/**
* The object that triggered the execution. In an event-driven architecture,
* this is typically just another event. In the BlueBerry workbench, this is
* typically an SWT event. This value may be null
.
*/
const Object::ConstPointer trigger;
public:
/**
* Constructs a new instance of ExecutionEvent
with no
* parameters, no trigger and no application context. This is just a
* convenience method.
*/
ExecutionEvent();
/**
* Constructs a new instance of ExecutionEvent
.
*
* @param command
* The command being executed; may be null
.
* @param parameters
* The parameters to qualify the execution; must not be
* null
. This must be a map of parameter ids (String
)
* to parameter values (String
).
* @param trigger
* The object that triggered the execution; may be
* null
.
* @param applicationContext
* The state of the application at the time the execution was
* triggered; may be null
.
*/
ExecutionEvent(const Command::ConstPointer& command, const ParameterMap& parameters,
const Object::ConstPointer& trigger, const Object::Pointer& applicationContext);
/**
* Returns the state of the application at the time the execution was
* triggered.
*
* @return The application context; may be null
.
*/
const Object::Pointer GetApplicationContext() const;
/**
* Returns the command being executed.
*
* @return The command being executed.
*/
const Command::ConstPointer GetCommand() const;
/**
* Returns the object represented by the string value of the parameter with
* the provided id.
* ExecutionException
to be thrown.
* null
.
* @return The parameter value; null
if the parameter cannot
* be found.
*/
QString GetParameter(const QString ¶meterId) const;
/**
* Returns all of the parameters.
*
* @return The parameters; never null
, but may be empty.
*/
const ParameterMap& GetParameters() const;
/**
* Returns the object that triggered the execution
*
* @return The trigger; null
if there was no trigger.
*/
const Object::ConstPointer GetTrigger() const;
/**
* The string representation of this execution event -- for debugging
* purposes only. This string should not be shown to an end user.
*/
QString ToString() const override;
};
}
#endif /*BERRYEXECUTIONEVENT_H_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/berryEvaluationContext.h b/Plugins/org.blueberry.core.expressions/src/berryEvaluationContext.h
index de5874b8b1..6a37bbfbcd 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryEvaluationContext.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryEvaluationContext.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEVALUATIONCONTEXT_H_
#define BERRYEVALUATIONCONTEXT_H_
#include "berryIEvaluationContext.h"
#include "berryIVariableResolver.h"
#include null
.
* @param defaultVariable the default variable
*/
EvaluationContext(IEvaluationContext* parent, const Object::ConstPointer& defaultVariable);
/**
* Create a new evaluation context with the given parent and default
* variable.
*
* @param parent the parent context. Can be null
.
* @param defaultVariable the default variable
* @param resolvers an array of IVariableResolvers
to
* resolve additional variables.
*
- * @see #resolveVariable(String, Object[])
+ * @see #ResolveVariable
*/
EvaluationContext(IEvaluationContext* parent, const Object::ConstPointer& defaultVariable,
const std::vectorFALSE_EVAL
, TRUE_EVAL
and
* NOT_LOADED
. NOT_LOADED
represents
* the fact that an expression couldn't be evaluated since a
* plug-in providing certain test expressions isn't loaded yet.
* and
*
, or
and not
. The operation are
* defined as follows:
*
- *
*
*
* AND
* FALSE_EVAL
* TRUE_EVAL
* NOT_LOADED
*
*
* FALSE_EVAL
* FALSE_EVAL
* FALSE_EVAL
* FALSE_EVAL
*
*
* TRUE_EVAL
* FALSE_EVAL
* TRUE_EVAL
* NOT_LOADED
*
*
- *
* NOT_LOADED
* FALSE_EVAL
* NOT_LOADED
* NOT_LOADED
*
- *
*
*
* OR
* FALSE_EVAL
* TRUE_EVAL
* NOT_LOADED
*
*
* FALSE_EVAL
* FALSE_EVAL
* TRUE_EVAL
* NOT_LOADED
*
*
* TRUE_EVAL
* TRUE_EVAL
* TRUE_EVAL
* TRUE_EVAL
*
*
- *
* NOT_LOADED
* NOT_LOADED
* TRUE_EVAL
* NOT_LOADED
*
- *
*
*
- *
* NOT
+ * NOT
* FALSE_EVAL
* TRUE_EVAL
* NOT_LOADED
*
*
- *
*
* TRUE_EVAL
* FALSE_EVAL
* NOT_LOADED
* EvaluationResult
*/
EvaluationResult(int value);
EvaluationResult(const EvaluationResult& o);
public:
berryObjectMacro(berry::EvaluationResult);
bool operator==(const Object*) const override;
bool operator!=(const Object*) const;
/**
* Returns an EvaluationResult
whose value is this && other)
.
*
* @param other the right hand side of the and operation.
*
* @return this && other
as defined by the evaluation result
*/
EvaluationResult::ConstPointer And(const EvaluationResult::ConstPointer& other) const;
/**
* Returns an EvaluationResult
whose value is this || other)
.
*
* @param other the right hand side of the or operation.
*
* @return this || other
as defined by the evaluation result
*/
EvaluationResult::ConstPointer Or(const EvaluationResult::ConstPointer& other) const;
/**
* Returns the inverted value of this evaluation result
*
* @return the inverted value of this evaluation result
*/
EvaluationResult::ConstPointer Not() const;
/**
* Returns an evaluation result instance representing the
* given boolean value. If the given boolean value is
* TRUE_EVAL
then ExpressionResult.TRUE_EVAL
* is returned. If the value is FALSE_EVAL
then
* ExpressionResult.FALSE_EVAL
is returned.
*
* @param b a boolean value
*
* @return the expression result representing the boolean
* value
*/
static EvaluationResult::ConstPointer ValueOf(bool b);
/**
* For debugging purpose only
*
* @return a string representing this object. The result is not
* human readable
*/
QString ToString() const override;
};
} // namespace berry
#endif /*BERRYEVALUATIONRESULT_*/
diff --git a/Plugins/org.blueberry.core.expressions/src/berryExpression.h b/Plugins/org.blueberry.core.expressions/src/berryExpression.h
index 24922ea25a..620027e477 100644
--- a/Plugins/org.blueberry.core.expressions/src/berryExpression.h
+++ b/Plugins/org.blueberry.core.expressions/src/berryExpression.h
@@ -1,220 +1,207 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEXPRESSION_H_
#define BERRYEXPRESSION_H_
#include "berryExpressionInfo.h"
#include "berryIEvaluationContext.h"
#include "berryEvaluationResult.h"
#include value
).
*/
static const QString ATT_VALUE;
private:
/**
* The hash code for this object. This value is computed lazily. If it is
* not yet computed, it is equal to {@link #HASH_CODE_NOT_COMPUTED}.
*/
mutable uint fHashCode;
protected:
- /**
- * Checks whether two objects are equal using the
- * equals(Object)
method of the left
object.
- * This method handles null
for either the left
- * or right
object.
- *
- * @param left the first object to compare; may be null
.
- * @param right the second object to compare; may be null
.
- * @return TRUE_EVAL
if the two objects are equivalent;
- * FALSE_EVAL
otherwise.
- */
- // static bool Equals(final Object left, final Object right);
-
/**
* Tests whether two arrays of objects are equal to each other. The arrays
* must not be null
, but their elements may be
* null
.
*
* @param leftArray the left array to compare; may be null
, and
* may be empty and may contain null
elements.
* @param rightArray the right array to compare; may be null
,
* and may be empty and may contain null
elements.
*
* @return TRUE_EVAL
if the arrays are equal length and the elements
* at the same position are equal; FALSE_EVAL
otherwise.
*/
static bool Equals(const QListobject
. This method
* handles null
.
*
* @param object the object for which the hash code is desired; may be
* null
.
*
* @return The hash code of the object; zero if the object is
* null
.
*/
static uint HashCode(Expression::Pointer object);
/**
* Returns the hash code for the given array. This method handles
* null
.
*
* @param array the array for which the hash code is desired; may be
* null
.
* @return the hash code of the array; zero if the object is
* null
.
*/
static uint HashCode(const QListfHashCode
* field. If the value returned from the method equals {@link #HASH_CODE_NOT_COMPUTED}
* (e.g. -1
) then the value is incremented by one.
* super.hashCode()
* null
* if the configuration element cannot be converted
*
* @throws CoreException if the configuration element can't be
* converted. Reasons include: (a) no handler is available to
* cope with a certain configuration element or (b) the XML
* expression tree is malformed.
*/
SmartPointernull
* if the element cannot be converted
*
* @throws CoreException if the element can't be converted.
* Reasons include: (a) no handler is available to cope with
* a certain element or (b) the XML expression tree is malformed.
*/
SmartPointertrue
if the default variable is accessed
* by the expression tree.
*
* @return whether the default variable is accessed or not
*/
bool HasDefaultVariableAccess() const;
/**
* Marks the default variable as accessed.
*/
void MarkDefaultVariableAccessed();
/**
* Returns true
if the system property is accessed
* by the expression tree.
*
* @return whether the system property is accessed or not
*/
bool HasSystemPropertyAccess() const;
/**
* Marks the system property as accessed.
*/
void MarkSystemPropertyAccessed();
/**
* Returns the set off accessed variables.
*
* @return the set off accessed variables
*/
QSetnull
if
* all expressions implement the method.
*
* @return the set of expression types which don't implement the
* computeReevaluationInfo
method.
*/
QSetEvaluationContext
.
* false
* will be returned.
*/
static Object::ConstPointer UNDEFINED_VARIABLE;
~IEvaluationContext() override;
/**
* Returns the parent context or null
if
* this is the root of the evaluation context hierarchy.
*
* @return the parent evaluation context or null
*/
virtual IEvaluationContext* GetParent() const = 0;
/**
* Returns the root evaluation context.
*
* @return the root evaluation context
*/
virtual IEvaluationContext* GetRoot() const = 0;
/**
* Specifies whether this evaluation context allows activation
* of plug-ins for testers used in the expression tree. To actual
* trigger the plug-in loading this flag has to be set to
* true
and the actual test expression must have the
* attribute forcePluginActivation
set to
* true
as well.
*
* @param value whether this evaluation context allows plug-in activation
* @since 3.2
*/
virtual void SetAllowPluginActivation(bool value) = 0;
/**
* Returns whether this evaluation context supports plug-in
- * activation. If not set via {@link #setAllowPluginActivation(boolean)}
+ * activation. If not set via {@link #SetAllowPluginActivation}
* the parent value is returned. If no parent is set false
* is returned.
*
* @return whether plug-in activation is supported or not
* @since 3.2
*/
virtual bool GetAllowPluginActivation() const = 0;
/**
* Returns the default variable.
*
* @return the default variable or null
if
* no default variable is managed.
*/
virtual Object::ConstPointer GetDefaultVariable() const = 0;
/**
* Adds a new named variable to this context. If a variable
* with the name already exists the new one overrides the
* existing one.
*
* @param name the variable's name
* @param value the variable's value
*/
virtual void AddVariable(const QString& name, const Object::ConstPointer& value) = 0;
/**
* Removes the variable managed under the given name
* from this evaluation context.
*
* @param name the variable's name
* @return the currently stored value or null
if
* the variable doesn't exist
*/
virtual Object::ConstPointer RemoveVariable(const QString& name) = 0;
/**
* Returns the variable managed under the given name.
*
* @param name the variable's name
* @return the variable's value or null
if the content
* doesn't manage a variable with the given name
*/
virtual Object::ConstPointer GetVariable(const QString& name) const = 0;
/**
* Resolves a variable for the given name and arguments. This
* method can be used to dynamically resolve variable such as
* plug-in descriptors, resources, etc. The method is used
* by the resolve
expression.
*
* @param name the variable to resolve
* @param args an object array of arguments used to resolve the
* variable
* @return the variable's value or null
if no variable
* can be resolved for the given name and arguments
* @exception CoreException if an errors occurs while resolving
* the variable
*/
virtual Object::ConstPointer ResolveVariable(const QString& name, const QList-1
if not applicable for this type of event.
* This value is only applicable for the scheduled
event.
*
* @return the delay time for this event
*/
virtual Poco::Timestamp::TimeDiff GetDelay() const = 0;
/**
* The job on which this event occurred.
*
* @return the job for this event
*/
virtual SmartPointernull
if
* not applicable. This value is only applicable for the done
event.
*
* @return the status for this event
*/
virtual IStatus::Pointer GetResult() const = 0;
};
}
#endif /* BERRYIJOBCHANGEEVENT_H_ */
diff --git a/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h b/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h
index 14ab9d6c19..1d8e41422f 100644
--- a/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h
+++ b/Plugins/org.blueberry.core.jobs/src/berryIJobChangeListener.h
@@ -1,153 +1,140 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIJOBCHANGELISTENER_H_
#define BERRYIJOBCHANGELISTENER_H_
#include "berryIJobChangeEvent.h"
namespace berry
{
/**
* Callback interface for clients interested in being notified when jobs change state.
* Job#GetState()
* method on jobs for which notification is occurring. Listeners are notified of
* all job state changes, but whether the state change occurs before, during, or
* after listeners are notified is unspecified.
*
*
*
* @see Job
* @see ILock
*
- * @noimplement This interface is not intended to be implemented by clients.
+ * @note This interface is not intended to be implemented by clients.
*/
struct BERRY_JOBS IJobManager: public Object
{
berryObjectMacro(berry::IJobManager);
/**
* A system property key indicating whether the job manager should create
* job threads as daemon threads. Set to schedule
method.true
to force all worker
* threads to be created as daemon threads. Set to false
to force
* all worker threads to be created as non-daemon threads.
*
* not used yet
*/
static const std::string PROP_USE_DAEMON_THREADS ;
/**
* Registers a job listener with the job manager.
* Has no effect if an identical listener is already registered.
*
* @param listener the listener to be added
- * @see #removeJobChangeListener(IJobChangeListener)
+ * @see #RemoveJobChangeListener
* @see IJobChangeListener
*/
virtual void AddJobChangeListener(IJobChangeListener* listener) = 0;
- ///**
- // * Begins applying this rule in the calling thread. If the rule conflicts with another
- // * rule currently running in another thread, this method blocks until there are
- // * no conflicting rules. Calls to beginRule must eventually be followed
- // * by a matching call to endRule in the same thread and with the identical
- // * rule instance.
- // * null
can be used, but will be ignored for scheduling
- // * purposes. The outermost non-null rule in the thread will be used for scheduling. A
- // * null
rule that is begun must still be ended.
- // *
- // * final ISchedulingRule rule = ...;
- // * try {
- // * manager.beginRule(rule, monitor);
- // * } finally {
- // * manager.endRule(rule);
- // * }
- // *
- // *
- // * @param rule the rule to begin applying in this thread, or null
- // * @param monitor a progress monitor, or null
if progress
- // * reporting and cancellation are not desired
- // * @throws IllegalArgumentException if the rule is not strictly nested within
- // * all other rules currently active for this thread
- // * @throws OperationCanceledException if the supplied monitor reports cancelation
- // * before the rule becomes available
- // * @see ISchedulingRule#contains(ISchedulingRule)
- // */
-
- /// virtual void BeginRule(const ISchedulingRule& rule, const IProgressMonitor& monitor) = 0;
-
- ///**
- // * Cancels all jobs in the given job family. Jobs in the family that are currently waiting
- // * will be removed from the queue. Sleeping jobs will be discarded without having
- // * a chance to wake up. Currently executing jobs will be asked to cancel but there
- // * is no guarantee that they will do so.
- // *
- // * @param family the job family to cancel, or null
to cancel all jobs
- // * @see Job#belongsTo(Object)
- // */
- /// virtual void Cancel(const Object& family);
-
/**
* Returns a progress monitor that can be used to provide
* aggregated progress feedback on a set of running jobs. A user
* interface will typically group all jobs in a progress group together,
* providing progress feedback for individual jobs as well as aggregated
* progress for the entire group. Jobs in the group may be run sequentially,
* in parallel, or some combination of the two.
*
- * Job parseJob, compileJob;
- * IProgressMonitor pm = Platform.getJobManager().createProgressGroup();
- * try {
- * pm.beginTask("Building", 10);
- * parseJob.setProgressGroup(pm, 5);
- * parseJob.schedule();
- * compileJob.setProgressGroup(pm, 5);
- * compileJob.schedule();
- * parseJob.join();
- * compileJob.join();
- * } finally {
- * pm.done();
- * }
- *
+ * \code
+ * Job parseJob, compileJob;
+ * IProgressMonitor pm = Platform.getJobManager().createProgressGroup();
+ * try {
+ * pm.beginTask("Building", 10);
+ * parseJob.setProgressGroup(pm, 5);
+ * parseJob.schedule();
+ * compileJob.setProgressGroup(pm, 5);
+ * compileJob.schedule();
+ * parseJob.join();
+ * compileJob.join();
+ * } finally {
+ * pm.done();
+ * }
+ * \endcode
*
- * @see Job#setProgressGroup(IProgressMonitor, int)
+ * @see Job#SetProgressGroup
* @see IProgressMonitor
* @return a progress monitor
*/
virtual IProgressMonitor::Pointer CreateProgressGroup() = 0;
- ///**
- // * Returns the job that is currently running in this thread, or null
if there
- // * is no currently running job.
- // *
- // * @return the job or null
- // */
- //// virtual Job CurrentJob() = 0;
-
- ///**
- // * Ends the application of a rule to the calling thread. Calls to endRule
- // * must be preceded by a matching call to beginRule in the same thread
- // * with an identical rule instance.
- // * null
to find all jobs
- // * @return the job array
- // * @see Job#belongsTo(Object)
- // */
- /// virtual Job[] Find(const Object& family) = 0;
-
/**
* Returns whether the job manager is currently idle. The job manager is
* idle if no jobs are currently running or waiting to run.
*
* @return true
if the job manager is idle, and
* false
otherwise
* @since 3.1
*/
virtual bool IsIdle()= 0;
/**
* Returns whether the job manager is currently suspended.
*
* @return true
if the job manager is suspended, and
* false
otherwise
* @since 3.4
- * @see #suspend()
- * @see #resume()
*/
virtual bool IsSuspended() = 0;
- ///**
- // * Waits until all jobs of the given family are finished. This method will block the
- // * calling thread until all such jobs have finished executing, or until this thread is
- // * interrupted. If there are no jobs in
- // * the family that are currently waiting, running, or sleeping, this method returns
- // * immediately. Feedback on how the join is progressing is provided to a progress
- // * monitor.
- // * null
to join all jobs.
- // * @param monitor Progress monitor for reporting progress on how the
- // * wait is progressing, or null
if no progress monitoring is required.
- // * @exception InterruptedException if this thread is interrupted while waiting
- // * @exception OperationCanceledException if the progress monitor is canceled while waiting
- // * @see Job#belongsTo(Object)
- // * @see #suspend()
- // */
- /// virtual void Join(const Object& family, const IProgressMonitor& monitor)
- /// throw(InterruptedException, OperationCanceledException) = 0;
- ///**
- // * Creates a new lock object. All lock objects supplied by the job manager
- // * know about each other and will always avoid circular deadlock amongst
- // * themselves.
- // *
- // * @return the new lock object
- // */
- /// virtual ILock newLock() = 0;
-
/**
* Removes a job listener from the job manager.
* Has no effect if an identical listener is not already registered.
*
* @param listener the listener to be removed
- * @see #addJobChangeListener(IJobChangeListener)
+ * @see #AddJobChangeListener
* @see IJobChangeListener
*/
virtual void RemoveJobChangeListener(IJobChangeListener* listener) = 0;
- ///**
- // * Resumes execution of jobs after a previous suspend
. All
- // * jobs that were sleeping or waiting prior to the suspension, or that were
- // * scheduled while the job manager was suspended, will now be eligible
- // * for execution.
- // * suspend
. All
- // * jobs that were sleeping or waiting prior to the suspension, or that were
- // * scheduled while the job manager was suspended, will now be eligible
- // * for execution.
- // * resume
when the job manager is not suspended
- // * has no effect.
- // *
- // * @see #suspend()
- // * @see #isSuspended()
- // */
- ////virtual void Resume() = 0;
-
- ///**
- // * Provides a hook that is notified whenever a thread is about to wait on a lock,
- // * or when a thread is about to release a lock. This hook must only be set once.
- // * null
if no progress
* is needed
*/
- virtual void SetProgressProvider(ProgressProvider::Pointer) = 0;
-
- /**
- * Suspends execution of all jobs. Jobs that are already running
- * when this method is invoked will complete as usual, but all sleeping and
- * waiting jobs will not be executed until the job manager is resumed.
- * resume
. Further calls to suspend
- * when the job manager is already suspended are ignored.
- * beginRule
and
- // * endRule
on a suspended rule will not block the caller.
- // * The rule remains suspended until a subsequent call to
- // * resume(ISchedulingRule)
with the identical rule instance.
- // * Further calls to suspend
with an identical rule prior to calling
- // * resume
are ignored.
- // * null
.
- // * @param monitor a progress monitor, or null
if progress
- // * reporting is not desired
- // * @exception OperationCanceledException if the operation is canceled.
- // * Cancelation can occur even if no progress monitor is provided.
- // * @see #resume(ISchedulingRule)
- // */
- /// virtual void Suspend(const ISchedulingRule& rule, const IProgressMonitor& monitor) = 0;
-
- ///**
- // * Requests that all jobs in the given job family be suspended. Jobs currently
- // * waiting to be run will be removed from the queue and moved into the
- // * SLEEPING
state. Jobs that have been put to sleep
- // * will remain in that state until either resumed or canceled. This method has
- // * no effect on jobs that are not currently waiting to be run.
- // * wakeUp
.
- // *
- // * @param family the job family to sleep, or null
to sleep all jobs.
- // * @see Job#belongsTo(Object)
- // */
- /// virtual void Sleep(const Object& family) = 0;
-
- ///**
- // * Transfers ownership of a scheduling rule to another thread. The identical
- // * scheduling rule must currently be owned by the calling thread as a result of
- // * a previous call to beginRule
. The destination thread must
- // * not already own a scheduling rule.
- // * endRule
- // * in the calling thread followed by an immediate beginRule
in
- // * the destination thread. The destination thread is responsible for subsequently
- // * calling endRule
when it is finished using the rule.
- // * null
to wake up all jobs
- // * @see Job#belongsTo(Object)
- // */
- /// virtual void WakeUp(const Object& family) = 0;
-
+ virtual void SetProgressProvider(ProgressProvider::Pointer provider) = 0;
};
}
#endif /* IJOBMANAGER */
diff --git a/Plugins/org.blueberry.core.runtime/src/application/berryIApplication.h b/Plugins/org.blueberry.core.runtime/src/application/berryIApplication.h
index 35918795aa..ef409c007e 100644
--- a/Plugins/org.blueberry.core.runtime/src/application/berryIApplication.h
+++ b/Plugins/org.blueberry.core.runtime/src/application/berryIApplication.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIAPPLICATION_H_
#define BERRYIAPPLICATION_H_
#include org.blueberry.osgi.applications
extension-point.
*
* BlueBerry.exitdata
system property.
*/
static const int EXIT_RELAUNCH;
virtual ~IApplication();
/**
* Starts this application with the given context and returns a result. This
* method must not exit until the application is finished and is ready to exit.
* The content of the context is unchecked and should conform to the expectations of
* the application being invoked.Integer
is returned
* it is treated as the program exit code if BlueBerry is exiting.
* QStringList
.
* QStringList
.
* null
.
*
* @param contributor plugin associated with the contribution
* @return new registry contributor based on the Plugin
*/
static SmartPointerIAdaptable
* interface. Adapter factories are registered with an
* adapter manager.
* 0
if
* no such object can be found.
*
* A typical implementation would look like this:
*
*
* void* GetAdapter(void* adaptableObject, const std::type_info& adaptableType, const std::string& adapterType)
* {
* if (Image* img = CastHelper
*
* @param adaptableObject the adaptable object being queried
* (usually an instance of IAdaptable
)
- * @param adaptableType the type information for the adaptable object
* @param adapterType the type of adapter to look up
* @return a object castable to the given adapter type,
* or 0
if this adapter factory
* does not have an adapter of the given type for the
* given object
*/
virtual Object* GetAdapter(IAdaptable* adaptableObject, const std::string& adapterType) = 0;
/**
* Returns the collection of adapter types handled by this
* factory.
* getAdapter
requests.
* IAdaptable
* interface) tunnel IAdaptable.getAdapter
invocations to their
* adapter manager's IAdapterManger.getAdapter
method. The
* adapter manager then forwards this request unmodified to the IAdapterFactory.getAdapter
* method on one of the registered adapter factories.
* registerAdapters
* method. Alternatively, they can be registered declaratively using the
* org.blueberry.core.runtime.adapters
extension point. Factories registered
* with this extension point will not be able to provide adapters until their
* corresponding plugin has been activated.
* com.example.acme.Sticky
on resources in the workspace.
*
+ * \code
* IAdapterFactory pr = new IAdapterFactory() {
* public Class[] getAdapterList() {
* return new Class[] { com.example.acme.Sticky.class };
* }
* public Object getAdapter(Object adaptableObject, Class adapterType) {
* IResource res = (IResource) adaptableObject;
* QualifiedName key = new QualifiedName("com.example.acme", "sticky-note");
* try {
* com.example.acme.Sticky v = (com.example.acme.Sticky) res.getSessionProperty(key);
* if (v == null) {
* v = new com.example.acme.Sticky();
* res.setSessionProperty(key, v);
* }
* } catch (CoreException e) {
* // unable to access session property - ignore
* }
* return v;
* }
* }
* Platform.getAdapterManager().registerAdapters(pr, IResource.class);
- *
+ * \endcode
*
* LoadAdapter
method instead.
*
* @param adaptable the adaptable object being queried (usually an instance
* of IAdaptable
)
- * @param adapterTypeName the fully qualified name of the type of adapter to look up
* @return a Poco::Any castable to the given adapter type, or empty
* if the given adaptable object does not have an available adapter of the
* given type
*/
templatenull
if no such object can
* be found.
* null
.
* If activation of the plug-in providing the factory is required, use the
* loadAdapter
method instead.
*
* @param adaptable the adaptable object being queried (usually an instance
* of IAdaptable
)
* @param adapterTypeName the fully qualified name of the type of adapter to look up
* @return an object castable to the given adapter type, or null
* if the given adaptable object does not have an available adapter of the
* given type
*/
virtual Object* GetAdapter(const Object* adaptable, const QString& adapterTypeName) = 0;
/**
* Returns whether there is an adapter factory registered that may be able
* to convert adaptable
to an object of type adapterTypeName
.
* true
does not guarantee that
* a subsequent call to GetAdapter
with the same arguments
* will return a non-empty result. If the factory's plug-in has not yet been
* loaded, or if the factory itself returns nothing, then
* GetAdapter
will still return an empty Poco::Any.
*
- * @param adaptable the adaptable object being queried (usually an instance
+ * @param adaptableType the adaptable object being queried (usually an instance
* of IAdaptable
)
- * @param adapterTypeName the fully qualified class name of an adapter to
+ * @param adapterType the fully qualified class name of an adapter to
* look up
* @return true
if there is an adapter factory that claims
* it can convert adaptable
to an object of type adapterType
,
* and false
otherwise.
*/
virtual bool HasAdapter(const Object* adaptableType, const QString& adapterType) = 0;
templateadaptable
to an object of type adapterTypeName
.
*
*
IAdaptable
)
- * @param adapterTypeName the fully qualified class name of an adapter to
+ * @param adapterType the fully qualified class name of an adapter to
* look up
* @return a status of the adapter
*/
virtual int QueryAdapter(const Object* adaptableType, const QString& adapterType) = 0;
/**
* Returns an object that is an instance of the given class name associated
* with the given object. Returns an empty Poco::Any if no such object can
* be found.
* GetAdapter
methods, this method
* will cause the plug-in that contributes the adapter factory to be loaded
* if necessary. As such, this method should be used judiciously, in order
* to avoid unnecessary plug-in activations. Most clients should avoid
* activation by using GetAdapter
instead.
*
* @param adaptable the adaptable object being queried (usually an instance
* of IAdaptable
)
- * @param adapterTypeName the fully qualified name of the type of adapter to look up
* @return a Poco::Any castable to the given adapter type, or empty
* if the given adaptable object does not have an available adapter of the
* given type
*/
templateUnregisterAdapters(IAdapterFactory*, const std::string&)
* on all classes against which it had been explicitly registered. Does
* nothing if the given factory is not currently registered.
*
* @param factory the adapter factory to remove
- * @see #RegisterAdapters(IAdapterFactory*, const std::string&)
+ * @see #RegisterAdapters
*/
virtual void UnregisterAdapters(IAdapterFactory* factory) = 0;
/**
* Removes the given adapter factory from the list of factories registered
* as extending the given class. Does nothing if the given factory and type
* combination is not registered.
*
* @param factory the adapter factory to remove
* @param adaptableTypeName one of the type names against which the given factory is
* registered
- * @see #RegisterAdapters(IAdapterFactory*, const std::string&)
+ * @see #RegisterAdapters
*/
virtual void UnregisterAdapters(IAdapterFactory* factory,
const QString& adaptableTypeName) = 0;
private:
virtual Object* GetAdapter(const Object* adaptable, const QString& adapterType, bool force) = 0;
};
} // namespace berry
Q_DECLARE_INTERFACE(berry::IAdapterManager, "org.blueberry.service.IAdapterManager")
#endif /*BERRYIADAPTERMANAGER_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/dynamichelpers/berryIExtensionTracker.h b/Plugins/org.blueberry.core.runtime/src/dynamichelpers/berryIExtensionTracker.h
index f9cb0820f2..70438d483d 100644
--- a/Plugins/org.blueberry.core.runtime/src/dynamichelpers/berryIExtensionTracker.h
+++ b/Plugins/org.blueberry.core.runtime/src/dynamichelpers/berryIExtensionTracker.h
@@ -1,140 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*//*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEXTENSIONTRACKER_H
#define BERRYIEXTENSIONTRACKER_H
#include null
if none
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetAttribute(const QString& name) const = 0;
/**
* Returns the names of the attributes of this configuration element.
* Returns an empty list if this configuration element has no attributes.
*
* <bg color="blue" pattern="stripes"/>
*
* corresponds to a configuration element named "bg"
* with attributes named "color"
* and "pattern"
.
*
- * <view>
- *     <verticalHint>top</verticalHint>
- *     <horizontalHint>left</horizontalHint>
- * </view>
- *
+ * \code{.unparsed}
+ * "view"
,
* with two children.
*
* <wizard name="Create Project"/>
*
* corresponds to a configuration element named "wizard"
.
*
* @return the name of this configuration element
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetName() const = 0;
/**
* Returns the element which contains this element. If this element
* is an immediate child of an extension, the
* returned value can be downcast to IExtension
.
* Otherwise the returned value can be downcast to
* IConfigurationElement
.
*
* @return the parent of this configuration element
* or null
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual SmartPointer
- * <script lang="javascript">.\scripts\cp.js</script>
- *
- * corresponds to a configuration element "script"
+ * \code{.unparsed}
+ *
+ * \endcode
+ * corresponds to a configuration element "script"
* with value ".\scripts\cp.js"
.
* null
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetValue() const = 0;
/**
* When multi-language support is enabled, this method returns the text value of this
* configuration element in the specified locale, or null
if none.
* null
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
- * @see #GetValue(String)
* @see IExtensionRegistry#IsMultiLanguage()
*/
virtual QString GetValue(const QLocale& locale) const = 0;
/**
* Returns the namespace name for this configuration element.
*
* @return the namespace name for this configuration element
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual QString GetNamespaceIdentifier() const = 0;
/**
* Returns the contributor of this configuration element.
*
* @return the contributor for this configuration element
* @throws InvalidRegistryObjectException if this configuration element is no longer valid
*/
virtual SmartPointertrue
if the object is valid, and false
* if it is no longer valid
*/
virtual bool IsValid() const = 0;
};
} // namespace berry
Q_DECLARE_INTERFACE(berry::IConfigurationElement, "org.blueberry.core.IConfigurationElement")
#endif /*BERRYIEXTENSIONELEMENT_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h
index 2b353ffc4f..a3c73d630b 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIContributor.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTOR_H
#define BERRYICONTRIBUTOR_H
#include "berryObject.h"
#include plugin.xml
) file.
* InvalidRegistryObjectException
as if it were a checked exception.
* Also, such clients should probably register a listener with the extension registry
* so that they receive notification of any changes to the registry.
* plugin.xml
)
* file for the plug-in that declares this extension.
* Returns an empty array if this extension does not declare any
* configuration elements.
*
* @return the configuration elements declared by this extension
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QListnull
* if this extension does not have an identifier.
* This identifier is specified in the extensions manifest
* file as a non-empty string containing no period characters
* ('.'
) and must be unique within the defining host.
*
* @return the simple identifier of the extension (e.g. "main"
)
* or null
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetSimpleIdentifier() const = 0;
/**
* Returns the unique identifier of this extension, or null
* if this extension does not have an identifier.
* If available, this identifier is unique within the extension registry, and
* is composed of the identifier of the host that declared
* this extension and this extension's simple identifier.
*
* @return the unique identifier of the extension
* (e.g. "com.example.acme.main"
), or null
* @throws InvalidRegistryObjectException if this extension is no longer valid
*/
virtual QString GetUniqueIdentifier() const = 0;
/**
* Returns whether this extension object is valid.
*
* @return true
if the object is valid, and false
* if it is no longer valid
*/
virtual bool IsValid() const = 0;
};
}
#endif /*BERRYIEXTENSION_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h
index faa799e5df..6e7e814c39 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionPoint.h
@@ -1,163 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEXTENSIONPOINT_H_
#define BERRYIEXTENSIONPOINT_H_
#include plugin.xml
) file.
* InvalidRegistryObjectException
as if it were a checked exception.
* Also, such clients should probably register a listener with the extension registry
* so that they receive notification of any changes to the registry.
* null
if there is no such extension.
* Since an extension might not have an identifier, some extensions
* can only be found via the getExtensions
method.
*
* @param extensionId the unique identifier of an extension
* (e.g. "com.example.acme.main"
).
* @return an extension, or null
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual SmartPointer'.'
) and is guaranteed
* to be unique within the defining plug-in.
*
* @return the simple identifier of the extension point (e.g. "builders"
)
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QString GetSimpleIdentifier() const = 0;
/**
* Returns the unique identifier of this extension point.
* This identifier is unique within the plug-in registry, and
* is composed of the namespace for this extension point
* and this extension point's simple identifier.
*
*
* @return the unique identifier of the extension point
* (e.g. "org.blueberry.core.resources.builders"
)
* @throws InvalidRegistryObjectException if this extension point is no longer valid
*/
virtual QString GetUniqueIdentifier() const = 0;
/**
* Returns whether this extension point object is valid.
*
* @return true
if the object is valid, and false
* if it is no longer valid
*/
virtual bool IsValid() const = 0;
};
}
#endif /*BERRYIEXTENSIONPOINT_H_*/
diff --git a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionRegistry.h b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionRegistry.h
index b87c4d70c7..a42b906847 100644
--- a/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionRegistry.h
+++ b/Plugins/org.blueberry.core.runtime/src/registry/berryIExtensionRegistry.h
@@ -1,401 +1,396 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEXTENSIONREGISTRY_H
#define BERRYIEXTENSIONREGISTRY_H
#include "org_blueberry_core_runtime_Export.h"
#include isValid()
will throw {@link org.eclipse.core.runtime.InvalidRegistryObjectException}.
+ * isValid()
will throw {@link InvalidRegistryObjectException}.
* Code in a plug-in that has declared that it is not dynamic aware (or not declared
* anything) can safely ignore this issue, since the registry would not be
* modified while it is active. However, code in a plug-in that declares that it
* is dynamic aware must be careful if it accesses extension registry objects,
* because it's at risk if plug-in are removed. Similarly, tools that analyze
* or display the extension registry are vulnerable. Client code can pre-test for
* invalid objects by calling isValid()
, which never throws this exception.
* However, pre-tests are usually not sufficient because of the possibility of the
* extension registry object becoming invalid as a result of a concurrent activity.
* At-risk clients must treat InvalidRegistryObjectException
as if it
* were a checked exception. Also, such clients should probably register a listener
* with the extension registry so that they receive notification of any changes to
* the registry.
* "org.blueberry.core.applications"
)
* @return the configuration elements
*/
virtual QList"org.eclipse.core.resources"
)
* @param extensionPointName the simple identifier of the
* extension point (e.g. "builders"
)
* @return the configuration elements
*/
virtual QList"org.eclipse.core.resources"
)
* @param extensionPointName the simple identifier of the
* extension point (e.g. "builders"
)
* @param extensionId the unique identifier of the extension
* (e.g. "com.example.acme.coolbuilder"
)
* @return the configuration elements
*/
virtual QListnull
if there is no such extension.
*
* @param extensionId the unique identifier of the extension
* (e.g. "com.example.acme.coolbuilder"
)
* @return the extension, or null
*/
virtual SmartPointernull
if there is no such extension.
* The first parameter identifies the extension point, and the second
* parameter identifies an extension plugged in to that extension point.
*
* @param extensionPointId the unique identifier of the extension point
* (e.g. "org.eclipse.core.resources.builders"
)
* @param extensionId the unique identifier of the extension
* (e.g. "com.example.acme.coolbuilder"
)
* @return the extension, or null
*/
virtual SmartPointernull
if there is no such extension.
* The first two parameters identify the extension point, and the third
* parameter identifies an extension plugged in to that extension point.
*
- * @param namespace the namespace for the extension point
+ * @param namespaze the namespace for the extension point
* (e.g. "org.eclipse.core.resources"
)
* @param extensionPointName the simple identifier of the
* extension point (e.g. "builders"
)
* @param extensionId the unique identifier of the extension
* (e.g. "com.example.acme.coolbuilder"
)
* @return the extension, or null
*/
virtual SmartPointernull
if there is no such
* extension point.
*
* @param extensionPointId the unique identifier of the extension point
* (e.g., "org.blueberry.core.applications"
)
* @return the extension point, or null
*/
virtual SmartPointernull
if there is no such extension point.
*
- * @param namespace the namespace for the given extension point
+ * @param namespaze the namespace for the given extension point
* (e.g. "org.eclipse.core.resources"
)
* @param extensionPointName the simple identifier of the
* extension point (e.g. "builders"
)
* @return the extension point, or null
*/
virtual SmartPointer"org.eclipse.core.resources"
)
* @return the extension points in this registry declared in the given namespace
*/
virtual QListnull
* if there are no such extension points.
*
* @param contributor the contributor for the extensions (for OSGi registry, bundles and
* fragments are different contributors)
* @return the extension points, or null
* @since 3.4
*/
virtual QList"org.eclipse.core.resources"
)
* @return the extensions in this registry declared in the given namespace
*/
virtual QListnull
if there
* are no such extensions.
* @param contributor the contributor for the extensions (for OSGi registry, bundles and
* fragments are different contributors)
* @return the extensions, or null
*/
virtual QListfalse
,
* contribution is not persisted in the registry cache and is lost on BlueBerry restart
* @param name optional name of the contribution. Used for error reporting; might be QString()
* @param translationBundle optional translator used for translations; might be nullptr
* @param token the key used to check permissions
* @return true
if the contribution was successfully processed and false
otherwise
* @throws ctkInvalidArgumentException if an incorrect token is passed
*
* @see IContributor
*/
virtual bool AddContribution(QIODevice* is, const SmartPointertrue
if the extension was successfully removed, and false
otherwise
* @throws ctkInvalidArgumentException if an incorrect token is passed
*/
virtual bool RemoveExtension(const SmartPointertrue
if the extension point was successfully removed, and
* false
otherwise
* @throws ctkInvalidArgumentException if incorrect token is passed
*/
virtual bool RemoveExtensionPoint(const SmartPointertrue
if multiple languages are supported by this
* instance of the extension registry; false
otherwise.
*/
virtual bool IsMultiLanguage() const = 0;
};
}
Q_DECLARE_INTERFACE(berry::IExtensionRegistry, "org.blueberry.service.IExtensionRegistry")
#endif // BERRYIEXTENSIONREGISTRY_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h b/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h
index c22feb26b7..38c741102a 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryAbstractContributionFactory.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYABSTRACTCONTRIBUTIONFACTORY_H_
#define BERRYABSTRACTCONTRIBUTIONFACTORY_H_
#include
* AbstractContributionFactory contributions = new AbstractContributionFactory(
* "menu:org.eclipse.ui.tests.api.MenuTestHarness?after=additions") {
* public void CreateContributionItems(IMenuService menuService, List additions) {
* CommandContributionItem item = new CommandContributionItem(
* "org.eclipse.ui.tests.menus.helloWorld",
* "org.eclipse.ui.tests.commands.enabledHelloWorld", null, null,
* "Say Hello", null);
* additions.add(item);
* item = new CommandContributionItem(
* "org.eclipse.ui.tests.menus.refresh",
* "org.eclipse.ui.tests.commands.refreshView", null, null,
* "Refresh", null);
* menuService.registerVisibleWhen(item, new MyActiveContextExpression(
* "org.eclipse.ui.tests.myview.context"));
* additions.add(item);
* }
*
* public void releaseContributionItems(IMenuService menuService, List items) {
* // we have nothing to do
* }
* };
* IMenuService service = (IMenuService) PlatformUI.getWorkbench().getService(
* IMenuService.class);
* service.addContributionFactory(contributions);
*
*
* null
.
- * @param namespace
+ * @param namespaze
* the namespace for this contribution. May be null
.
- * @see #getNamespace()
+ * @see #GetNamespace
*/
AbstractContributionFactory(const QString& location,
const QString& namespaze);
/**
* Return the location as a String.
*
* @return the location - never null
.
*/
QString GetLocation() const;
/**
* This factory should create the IContributionItems that it wants to
* contribute, and add them to the additions list. The menu service will
* call this method at the appropriate time. It should always return new
* instances of its contributions in the additions list.
* null
.
* @see org.eclipse.ui.menus.CommandContributionItem
* @see org.eclipse.jface.action.MenuManager
*/
virtual void CreateContributionItems(IServiceLocator* serviceLocator,
const SmartPointernull
.
*/
IServiceLocator* serviceLocator;
/**
* The id for this item. May be null
. Items without an id
* cannot be referenced later.
*/
QString id;
/**
* A command id for a defined command. Must not be null
.
*/
QString commandId;
/**
* A map of strings to strings which represent parameter names to values.
* The parameter names must match those in the command definition. May be
* null
*/
QHashnull
.
*/
QIcon icon;
/**
* A label for this item. May be null
.
*/
QString label;
/**
* A mnemonic for this item to be applied to the label. May be
* null
.
*/
QChar mnemonic;
/**
* A shortcut key sequence. This is a workaround and will be
* removed when key binding support is fully implemented
*/
QKeySequence shortcut;
/**
* A tooltip for this item. May be null
. Tooltips are
* currently only valid for toolbar contributions.
*/
QString tooltip;
/**
* The style of this menu contribution. See the CommandContributionItem
* STYLE_* contants.
*/
CommandContributionItem::Style style;
/**
* The help context id to be applied to this contribution. May be
* null
*/
QString helpContextId;
/**
* The icon style to use.
*/
QString iconStyle;
/**
* The visibility tracking for a menu contribution.
*/
bool visibleEnabled;
/**
* Any number of mode bits, like
* {@link CommandContributionItem#MODE_FORCE_TEXT}.
*/
CommandContributionItem::Modes mode;
/**
* Create the parameter object. Nullable attributes can be set directly.
*
* @param serviceLocator
* a service locator that is most appropriate for this
* contribution. Typically the local {@link IWorkbenchWindow} or
* {@link IWorkbenchPartSite} will be sufficient. Must not be
* null
.
* @param id
* The id for this item. May be null
. Items
* without an id cannot be referenced later.
* @param commandId
* A command id for a defined command. Must not be
* null
.
* @param style
* The style of this menu contribution. See the STYLE_* contants.
*/
CommandContributionItemParameter(IServiceLocator* serviceLocator,
const QString& id, const QString& commandId,
CommandContributionItem::Style style);
/**
* Build the parameter object.
* null
.
* @param id
* The id for this item. May be null
. Items
* without an id cannot be referenced later.
* @param commandId
* A command id for a defined command. Must not be
* null
.
* @param parameters
* A map of strings to strings which represent parameter names to
* values. The parameter names must match those in the command
* definition. May be null
* @param icon
* An icon for this item. May be null
.
- * @param disabledIcon
- * A disabled icon for this item. May be null
.
- * @param hoverIcon
- * A hover icon for this item. May be null
.
* @param label
* A label for this item. May be null
.
* @param mnemonic
* A mnemonic for this item to be applied to the label. May be
* null
.
* @param tooltip
* A tooltip for this item. May be null
. Tooltips
* are currently only valid for toolbar contributions.
* @param style
* The style of this menu contribution. See the STYLE_* contants.
* @param helpContextId
* the help context id to be applied to this contribution. May be
* null
* @param visibleEnabled
* Visibility tracking for the menu contribution.
- * @noreference This constructor is not intended to be referenced by clients.
+ * @note This constructor is not intended to be referenced by clients.
*/
CommandContributionItemParameter(IServiceLocator* serviceLocator,
const QString& id, const QString& commandId,
const QHashIContributionItem
* method does nothing. Subclasses may override.
*/
void Fill(QStatusBar* parent) override;
/**
* The default implementation of this IContributionItem
* method does nothing. Subclasses may override.
*/
void Fill(QMenu* menu, QAction* before) override;
/**
* The default implementation of this IContributionItem
* method does nothing. Subclasses may override.
*/
void Fill(QMenuBar* menu, QAction* before) override;
/**
* The default implementation of this IContributionItem
* method does nothing. Subclasses may override.
*/
void Fill(QToolBar* parent, QAction* before) override;
/**
* The default implementation of this IContributionItem
* method does nothing. Subclasses may override.
*/
void SaveWidgetState() override;
/*
* Method declared on IContributionItem.
*/
QString GetId() const override;
/**
* Returns the parent contribution manager, or null
if this
* contribution item is not currently added to a contribution manager.
*
* @return the parent contribution manager, or null
*/
IContributionManager *GetParent() const;
/**
* The default implementation of this IContributionItem
* method returns false
. Subclasses may override.
*/
bool IsDirty() const override;
/**
* The default implementation of this IContributionItem
* method returns true
. Subclasses may override.
*/
bool IsEnabled() const override;
/**
* The default implementation of this IContributionItem
* method returns false
. Subclasses may override.
*/
bool IsDynamic() const override;
/**
* The default implementation of this IContributionItem
* method returns false
. Subclasses may override.
*/
bool IsGroupMarker() const override;
/**
* The default implementation of this IContributionItem
* method returns false
. Subclasses may override.
*/
bool IsSeparator() const override;
/**
* The default implementation of this IContributionItem
* method returns the value recorded in an internal state variable,
* which is true
by default. setVisible
* should be used to change this setting.
*/
bool IsVisible() const override;
/**
* The default implementation of this IContributionItem
* method stores the value in an internal state variable,
* which is true
by default.
*/
void SetVisible(bool visible) override;
/**
* Returns a string representation of this contribution item
* suitable only for debugging.
*/
QString ToString() const override;
/**
* The default implementation of this IContributionItem
* method does nothing. Subclasses may override.
*/
void Update() override;
/*
* Method declared on IContributionItem.
*/
void SetParent(IContributionManager* parent) override;
/**
* The ContributionItem
implementation of this
* method declared on IContributionItem
does nothing.
* Subclasses should override to update their state.
*/
void Update(const QString& id) override;
/**
* The ID for this contribution item. It should be set once either in the
* constructor or using this method.
*
* @param itemId
- * @see #getId()
+ * @see #GetId
*/
void SetId(const QString& itemId);
protected:
/**
* Creates a contribution item with a null
id.
* Calls this(String)
with null
.
*/
ContributionItem();
/**
* Creates a contribution item with the given (optional) id.
* The given id is used to find items in a contribution manager,
* and for positioning items relative to other items.
*
* @param id the contribution item identifier, or null
*/
ContributionItem(const QString& id);
private:
/**
* The identifier for this contribution item, of null
if none.
*/
QString id;
/**
* Indicates this item is visible in its manager; true
* by default.
*/
bool visible;
/**
* The parent contribution manager for this item
*/
IContributionManager* parent;
};
}
#endif // BERRYCONTRIBUTIONITEM_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h
index d62e7af4ce..cc6031961b 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryContributionManager.h
@@ -1,339 +1,339 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYCONTRIBUTIONMANAGER_H
#define BERRYCONTRIBUTIONMANAGER_H
#include "berryIContributionManager.h"
namespace berry {
struct IContributionManagerOverrides;
/**
* Abstract base class for all contribution managers, and standard
* implementation of IContributionManager
. This class provides
* functionality common across the specific managers defined by this framework.
* IContributionManager
methods, this class automatically
* coalesces adjacent separators, hides beginning and ending separators, and
* deals with dynamically changing sets of contributions. When the set of
* contributions does change dynamically, the changes are propagated to the
* control via the update
method, which subclasses must
* implement.
* ContributionItem
cannot be shared between different
* ContributionManager
s.
* ContributionManager
implementation of this method
* declared on IContributionManager
returns the current
* overrides. If there is no overrides it lazily creates one which overrides
* no item state.
*/
SmartPointerint
the index or -1 if the item is not found
*/
int IndexOf(const QString& id);
/**
* Insert the item at the given index.
*
* @param index
* The index to be used for insertion
* @param item
* The item to be inserted
*/
void Insert(int index, const SmartPointernull
.
* @param replacementItem
* The contribution item to replace the old item; must not be
* null
. Use
- * {@link org.eclipse.jface.action.ContributionManager#remove(java.lang.String) remove}
+ * {@link ContributionManager#Remove}
* if that is what you want to do.
- * @return true
if the given identifier can be;
+ * @return
or a true
if the given identifier can be
*/
bool ReplaceItem(const QString &identifier,
const SmartPointerContributionManager
to
* prevent certain items in the contributions list.
* ContributionManager
will either block or allow an addition
* based on the result of this method call. This can be used to prevent
* duplication, for example.
*
* @param itemToAdd
* The contribution item to be added; may be null
.
* @return true
if the addition should be allowed;
* false
otherwise. The default implementation allows
* all items.
*/
virtual bool AllowItem(IContributionItem* itemToAdd);
/**
* Internal debug method for printing statistics about this manager to
* cout
.
*/
void DumpStatistics();
/**
* Returns whether this contribution manager contains dynamic items. A
* dynamic contribution item contributes items conditionally, dependent on
* some internal state.
*
* @return true
if this manager contains dynamic items, and
* false
otherwise
*/
bool HasDynamicItems() const;
/**
* Returns the index of the object in the internal structure. This is
* different from indexOf(String id)
since some contribution
* items may not have an id.
*
* @param item
* The contribution item
* @return the index, or -1 if the item is not found
*/
int IndexOf(const SmartPointertrue
if this manager is dirty, and
* false
if it is up-to-date
*/
void SetDirty(bool dirty);
/**
* An internal method for setting the order of the contribution items.
*
* @param items
* the contribution items in the specified order
*/
void InternalSetItems(const QListtrue
to add to the end of the group, and
* false
to add the beginning of the group
* @exception IllegalArgumentException
* if there is no group with the given name
*/
void AddToGroup(const QString& groupName, const SmartPointernull
or the empty string.
* The group name is also used as the item id.
*
* @param groupName the name of the group
*/
GroupMarker(const QString& groupName);
/**
* The GroupMarker
implementation of this method
* returns false
since group markers are always invisible.
*/
bool IsVisible() const override;
};
}
#endif // BERRYGROUPMARKER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
index 471f8b5718..7c2600b8bf 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionItem.h
@@ -1,195 +1,194 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONITEM_H
#define BERRYICONTRIBUTIONITEM_H
#include fill
methods. The same type of contribution item can be used with a
* MenuBarManager
, ToolBarManager
,
- * StatusLineManager
.
+ * or a StatusLineManager
.
*
* This interface is internal to the framework; it should not be implemented outside * the framework. *
* * @see IContributionManager - * @noimplement This interface is not intended to be implemented by clients. */ struct IContributionItem : public virtual Object { berryObjectMacro(berry::IContributionItem); /** * Fills the given status bar control with controls representing this * contribution item. Used byStatusLineManager
.
*
* @param parent the parent control
*/
virtual void Fill(QStatusBar* parent) = 0;
/**
* Fills the given menu bar with controls representing this contribution item.
* Used by MenuBarManager
.
*
* @param parent the parent menu
* @param before
*/
virtual void Fill(QMenuBar* parent, QAction* before) = 0;
/**
* Fills the given menu with controls representing this contribution item.
* Used by MenuManager
.
*
* @param parent the parent menu
* @param before
*/
virtual void Fill(QMenu* parent, QAction* before) = 0;
/**
* Fills the given tool bar with controls representing this contribution item.
* Used by ToolBarManager
.
*
* @param parent the parent tool bar
* @param before
*/
virtual void Fill(QToolBar* parent, QAction* before) = 0;
/**
* Returns the identifier of this contribution item.
* The id is used for retrieving an item from its manager.
*
* @return the contribution item identifier, or null
* if none
*/
virtual QString GetId() const = 0;
/**
* Returns whether this contribution item is enabled.
*
* @return true
if this item is enabled
*/
virtual bool IsEnabled() const = 0;
/**
* Returns whether this contribution item is dirty. A dirty item will be
* recreated when the action bar is updated.
*
* @return true
if this item is dirty
*/
virtual bool IsDirty() const = 0;
/**
* Returns whether this contribution item is dynamic. A dynamic contribution
* item contributes items conditionally, dependent on some internal state.
*
* @return true
if this item is dynamic, and
* false
for normal items
*/
virtual bool IsDynamic() const = 0;
/**
* Returns whether this contribution item is a group marker.
* This information is used when adding items to a group.
*
* @return true
if this item is a group marker, and
* false
for normal items
*
* @see GroupMarker
* @see IContributionManager#appendToGroup(String, IContributionItem)
* @see IContributionManager#prependToGroup(String, IContributionItem)
*/
virtual bool IsGroupMarker() const = 0;
/**
* Returns whether this contribution item is a separator.
* This information is used to enable hiding of unnecessary separators.
*
* @return true
if this item is a separator, and
* false
for normal items
* @see Separator
*/
virtual bool IsSeparator() const = 0;
/**
* Returns whether this contribution item is visibile within its manager.
*
* @return true
if this item is visible, and
* false
otherwise
*/
virtual bool IsVisible() const = 0;
/**
* Saves any state information of the control(s) owned by this contribution item.
* The contribution manager calls this method before disposing of the controls.
*/
virtual void SaveWidgetState() = 0;
/**
* Sets the parent manager of this item
*
* @param parent the parent contribution manager
*/
virtual void SetParent(IContributionManager* parent) = 0;
/**
* Sets whether this contribution item is visibile within its manager.
*
* @param visible true
if this item should be visible, and
* false
otherwise
*/
virtual void SetVisible(bool visible) = 0;
/**
* Updates any controls cached by this contribution item with any
* changes which have been made to this contribution item since the last update.
* Called by contribution manager update methods.
*/
virtual void Update() = 0;
/**
* Updates any controls cached by this contribution item with changes
* for the the given property.
*
* @param id the id of the changed property
*/
virtual void Update(const QString& id) = 0;
};
}
#endif // BERRYICONTRIBUTIONITEM_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h
index 03ba9702a3..161f67233f 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManager.h
@@ -1,212 +1,206 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONMANAGER_H
#define BERRYICONTRIBUTIONMANAGER_H
#include * A contribution manager keeps track of a list of contribution * items. Each contribution item may has an optional identifier, which can be used * to retrieve items from a manager, and for positioning items relative to * each other. The list of contribution items can be subdivided into named groups * using special contribution items that serve as group markers. *
*
* The IContributionManager
interface provides general
* protocol for adding, removing, and retrieving contribution items.
* It also provides convenience methods that make it convenient
* to contribute actions. This interface should be implemented
* by all objects that wish to manage contributions.
*
- * There are several implementions of this interface in this package,
- * including ones for menus ({@link MenuManager MenuManager
}),
- * tool bars ({@link ToolBarManager ToolBarManager
}),
- * and status lines ({@link StatusLineManager StatusLineManager
}).
- *
Add(IContributionItem::Pointer(new QActionContributionItem(action, id)))
.
*
* @param action the action, this cannot be null
* @param id the unique action id
*/
virtual void Add(QAction* action, const QString& id) = 0;
/**
* Adds a contribution item to this manager.
*
* @param item the contribution item, this cannot be null
*/
virtual void Add(const SmartPointerAppendToGroup(groupName,IContributionItem::Pointer(new QActionContributionItem(action, id)))
.
*
* @param groupName the name of the group
* @param action the action
* @param id the unique action id
* @exception ctkInvalidArgumentException if there is no group with
* the given name
*/
virtual void AppendToGroup(const QString& groupName, QAction* action, const QString& id) = 0;
/**
* Adds a contribution item to this manager at the end of the group
* with the given name.
*
* @param groupName the name of the group
* @param item the contribution item
* @exception ctkInvalidArgumentException if there is no group with
* the given name
*/
virtual void AppendToGroup(const QString& groupName, const SmartPointernull
if
* no item with the given id can be found
*/
virtual SmartPointertrue
if this manager is dirty, and false
* if it is up-to-date
*/
virtual bool IsDirty() const = 0;
/**
* Returns whether this manager has any contribution items.
*
* @return true
if there are no items, and
* false
otherwise
*/
virtual bool IsEmpty() const = 0;
/**
* Marks this contribution manager as dirty.
*/
virtual void MarkDirty() = 0;
/**
* Adds a contribution item to this manager at the beginning of the
* group with the given name.
*
* @param groupName the name of the group
* @param item the contribution item
* @exception IllegalArgumentException if there is no group with
* the given name
*/
virtual void PrependToGroup(const QString& groupName, const SmartPointernull
if this manager has no contribution items
* with the given id.
*
* @param id the contribution item id
* @return the item that was found and removed, or null
if none
*/
virtual SmartPointeritem
parameter if the item was removed,
* and null
if it was not found
*/
virtual SmartPointertrue
means update even if not dirty,
* and false
for normal incremental updating
*/
virtual void Update(bool force) = 0;
};
}
#endif // BERRYICONTRIBUTIONMANAGER_H
diff --git a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
index d0d32c8408..8fdb67e9a7 100644
--- a/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
+++ b/Plugins/org.blueberry.ui.qt/src/actions/berryIContributionManagerOverrides.h
@@ -1,75 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICONTRIBUTIONMANAGEROVERRIDES_H
#define BERRYICONTRIBUTIONMANAGEROVERRIDES_H
#include IContributionItem
* to determine if the values for certain properties have been overriden
* by their manager.
* * This interface is internal to the framework; it should not be implemented outside * the framework. *
- * - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IContributionManagerOverrides : virtual Object { berryObjectMacro(berry::IContributionManagerOverrides); /** * Id for the enabled property. Value is"enabled"
.
*/
static const QString P_ENABLED;
/**
* Find out the enablement of the item
* @param item the contribution item for which the enable override value is
* determined
- * @param defaultValue the default value
* @return 1
if the given contribution item should be enabled0
if the item should not be enabled-1
if the item may determine its own enablement1
if the given contribution item should be visible0
if the item should not be visible-1
if the item may determine its own visibility* Note that these objects are only available to the main application * (the plug-in that creates and owns the workbench). *
** This interface is not intended to be implemented by clients. *
* * @see org.blueberry.ui.application.WorkbenchAdvisor#fillActionBars - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IActionBarConfigurer : public Object { berryObjectMacro(berry::IActionBarConfigurer); ~IActionBarConfigurer() override; /** * Returns the workbench window configurer for the window * containing this configurer's action bars. * * @return the workbench window configurer */ virtual SmartPointerMenuManager
directly.
*
* @return the menu manager
*/
virtual IMenuManager* GetMenuManager() = 0;
/**
* Creates a tool bar manager for the workbench window's tool bar. The
* action bar advisor should use this factory method rather than creating a
* ToolBarManager
directly.
*
* @return the tool bar manager
*/
virtual IToolBarManager* GetToolBarManager() = 0;
/*
* Returns the status line manager of a workbench window.
*
* @return the status line manager
*/
//virtual IStatusLineManager GetStatusLineManager() = 0;
/*
* Register the action as a global action with a workbench
* window.
* * For a workbench retarget action * ({@link org.blueberry.ui.actions.RetargetAction RetargetAction}) * to work, it must be registered. * You should also register actions that will participate * in custom key bindings. *
* * @param action the global action * @see org.blueberry.ui.actions.RetargetAction */ //virtual void RegisterGlobalAction(IAction action) = 0; }; } #endif /*BERRYIACTIONBARCONFIGURER_H_*/ diff --git a/Plugins/org.blueberry.ui.qt/src/berryAbstractUICTKPlugin.h b/Plugins/org.blueberry.ui.qt/src/berryAbstractUICTKPlugin.h index e619d2af76..1c2582ff86 100644 --- a/Plugins/org.blueberry.ui.qt/src/berryAbstractUICTKPlugin.h +++ b/Plugins/org.blueberry.ui.qt/src/berryAbstractUICTKPlugin.h @@ -1,290 +1,194 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef BERRYABSTRACTUICTKPLUGIN_H_ #define BERRYABSTRACTUICTKPLUGIN_H_ #include* Subclasses obtain the following capabilities: *
** Preferences *
org.blueberry.core.runtime.Preferences
).
* This class provides appropriate conversion to the older JFace preference
* API (org.blueberry.jface.preference.IPreferenceStore
).getPreferenceStore
returns the JFace preference
* store (cf. Plugin.getPluginPreferences
which returns
* a core runtime preferences object.initializeDefaultPreferences
* to set up any default values for preferences using JFace API. In this
* case, initializeDefaultPluginPreferences
should not be
* overridden.initializeDefaultPluginPreferences
to set up any default
* values for preferences using core runtime API. In this
* case, initializeDefaultPreferences
should not be
* overridden.getDialogSettings
* is called.FN_DIALOG_STORE
. A dialog store file is first
* looked for in the plug-in's read/write state area; if not found there,
* the plug-in's install directory is checked.
* This allows a plug-in to ship with a read-only copy of a dialog store
* file containing initial values for certain settings.saveDialogSettings
to cause settings to
* be saved in the plug-in's read/write state area. A plug-in may opt to do
* this each time a wizard or dialog is closed to ensure the latest
* information is always safe on disk.
* For easy access to your plug-in object, use the singleton pattern. Declare a
* static variable in your plug-in class for the singleton. Store the first
* (and only) instance of the plug-in class in the singleton when it is created.
* Then access the singleton when needed through a static getDefault
* method.
*
* See the description on {@link Plugin}. *
*/ class BERRY_UI_QT AbstractUICTKPlugin : public Plugin { Q_OBJECT private: /** * The name of the dialog settings file (value *"dialog_settings.xml"
).
*/
static const QString FN_DIALOG_SETTINGS;
- /**
- * Storage for dialog and wizard data; null
if not yet
- * initialized.
- */
- //DialogSettings dialogSettings = null;
-
/**
* Storage for preferences.
*/
mutable IPreferencesService* preferencesService;
- /**
- * The bundle listener used for kicking off refreshPluginActions().
- */
- //BundleListener bundleListener;
-
public:
/**
* Creates an abstract UI plug-in runtime object.
*
* Plug-in runtime classes are ctkPluginActivator
s and so must
* have an default constructor. This method is called by the runtime when
* the associated bundle is being activated.
*/
AbstractUICTKPlugin();
- /**
- * Returns the dialog settings for this UI plug-in.
- * The dialog settings is used to hold persistent state data for the various
- * wizards and dialogs of this plug-in in the context of a workbench.
- *
- * If an error occurs reading the dialog store, an empty one is quietly created - * and returned. - *
- *- * Subclasses may override this method but are not expected to. - *
- * - * @return the dialog settings - */ -// IDialogSettings getDialogSettings(); - /** * Returns the preferences service for this UI plug-in. * This preferences service is used to hold persistent settings for this plug-in in * the context of a workbench. Some of these settings will be user controlled, * whereas others may be internal setting that are never exposed to the user. ** If an error occurs reading the preferences service, an empty preference service is * quietly created, initialized with defaults, and returned. *
* * @return the preferences service */ IPreferencesService* GetPreferencesService() const; SmartPointer
* This method exists as a convenience for plugin implementors. The
* workbench can also be accessed by invoking PlatformUI.getWorkbench()
.
*
- * The default implementation of this method creates an empty registry. - * Subclasses may override this method if needed. - *
- * - * @return ImageRegistry the resulting registry. - * @see #getImageRegistry - */ -// ImageRegistry createImageRegistry(); - - /** - * Initializes an image registry with images which are frequently used by the - * plugin. - *- * The image registry contains the images used by this plug-in that are very - * frequently used and so need to be globally shared within the plug-in. Since - * many OSs have a severe limit on the number of images that can be in memory - * at any given time, each plug-in should only keep a small number of images in - * its registry. - *
- * Implementors should create a JFace image descriptor for each frequently used - * image. The descriptors describe how to create/find the image should it be needed. - * The image described by the descriptor is not actually allocated until someone - * retrieves it. - *
- * Subclasses may override this method to fill the image registry. - *
- * @param reg the registry to initalize - * - * @see #getImageRegistry - */ -// void initializeImageRegistry(ImageRegistry reg); - - /** - * Loads the dialog settings for this plug-in. - * The default implementation first looks for a standard named file in the - * plug-in's read/write state area; if no such file exists, the plug-in's - * install directory is checked to see if one was installed with some default - * settings; if no file is found in either place, a new empty dialog settings - * is created. If a problem occurs, an empty settings is silently used. - *- * This framework method may be overridden, although this is typically - * unnecessary. - *
- */ -// void loadDialogSettings(); - - - /** - * Refreshes the actions for the plugin. - * This method is called fromstartup
.
- * - * This framework method may be overridden, although this is typically - * unnecessary. - *
- */ -// void refreshPluginActions(); - - /** - * Saves this plug-in's dialog settings. - * Any problems which arise are silently ignored. - */ -// void saveDialogSettings(); - - public: /** * TheAbstractUIPlugin
implementation of this Plugin
* method refreshes the plug-in actions. Subclasses may extend this method,
* but must send super first.
+ *
+ * \param context
*/
void start(ctkPluginContext* context) override;
/**
* The AbstractUIPlugin
implementation of this Plugin
* method saves this plug-in's preference and dialog stores and shuts down
* its image registry (if they are in use). Subclasses may extend this
* method, but must send super last. A try-finally statement should
* be used where necessary to ensure that super.shutdown()
is
* always done.
*/
void stop(ctkPluginContext* context) override;
/**
* Creates and returns a new image descriptor for an image file located
* within the specified plug-in.
* * This is a convenience method that simply locates the image file in * within the plug-in (no image registries are involved). The path is * relative to the root of the plug-in, and takes into account files * coming from plug-in fragments. The path may include $arg$ elements. * However, the path must not have a leading "." or path separator. * Clients should use a path like "icons/mysample.gif" rather than * "./icons/mysample.gif" or "/icons/mysample.gif". *
* * @param pluginId the id of the plug-in containing the image file; *null
is returned if the plug-in does not exist
* @param imageFilePath the relative path of the image file, relative to the
* root of the plug-in; the path must be legal
* @return an image descriptor, or null
if no image
* could be found
*/
static QIcon ImageDescriptorFromPlugin(
const QString& pluginId, const QString& imageFilePath);
static QIcon GetMissingIcon();
};
} // namespace berry
#endif /*BERRYABSTRACTUICTKPLUGIN_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h b/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h
index b2a72fb275..1d25e52058 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryEditorPart.h
@@ -1,246 +1,245 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYEDITORPART_H_
#define BERRYEDITORPART_H_
#include
* This class should be subclassed by clients wishing to define new editors.
* The name of the subclass should be given as the "class"
* attribute in a editor
extension contributed to the workbench's
* editor extension point (named "org.mitk.ui.editors"
).
* For example, the plug-in's XML markup might contain:
- *
- * <extension point="org.blueberry.ui.editors"> - * <editor id="com.example.myplugin.ed" - * name="My Editor" - * icon="./images/cedit.gif" - * extensions="foo" - * class="com.example.myplugin.MyFooEditor" - * contributorClass="com.example.myplugin.MyFooEditorContributor" - * /> - * </extension> - *+ * \code{.unparsed} + *
com.example.myplugin.MyEditor
is the name of the
* EditorPart
subclass.
*
* * Subclasses must implement the following methods: *
IEditorPart.init
- to initialize editor when assigned its siteIWorkbenchPart.createPartControl
- to create the editor's controls IWorkbenchPart.setFocus
- to accept focusIEditorPart.isDirty
- to decide whether a significant change has
* occurredIEditorPart.doSave
- to save contents of editorIEditorPart.doSaveAs
- to save contents of editorIEditorPart.isSaveAsAllowed
- to control Save As* Subclasses may extend or reimplement the following methods as required: *
IExecutableExtension.setInitializationData
- extend to provide additional
* initialization when editor extension is instantiatedIWorkbenchPart.dispose
- extend to provide additional cleanupIAdaptable.getAdapter
- reimplement to make the editor
* adaptablenull
if none.
*/
IEditorInput::Pointer editorInput;
protected:
/**
* Creates a new workbench editor.
*/
EditorPart();
/**
* Sets the input to this editor. This method simply updates the internal
* member variable.
*
* Unlike most of the other set methods on this class, this method does * not fire a property change. Clients that call this method from a subclass * must ensure that they fire an IWorkbenchPartConstants.PROP_INPUT property * change after calling this method but before leaving whatever public method * they are in. Clients that expose this method as public API must fire * the property change within their implementation of setInput.
* *Note that firing a property change may cause listeners to immediately * reach back and call methods on this editor. Care should be taken not to * fire the property change until the editor has fully updated its internal * state to reflect the new input.
* * @param input the editor input * - * @see #setInputWithNotify(IEditorInput) + * @see #SetInputWithNotify */ virtual void SetInput(IEditorInput::Pointer input) ; /** * Sets the input to this editor and fires a PROP_INPUT property change if * the input has changed. This is the convenience method implementation. * *Note that firing a property change may cause other objects to reach back * and invoke methods on the editor. Care should be taken not to call this method * until the editor has fully updated its internal state to reflect the * new input.
* * @since 3.2 * * @param input the editor input */ virtual void SetInputWithNotify(IEditorInput::Pointer input); /* (non-Javadoc) * @see org.blueberry.ui.part.WorkbenchPart#setContentDescription(java.lang.String) */ void SetContentDescription(const QString& description) override; /* (non-Javadoc) * @see org.blueberry.ui.part.WorkbenchPart#setPartName(java.lang.String) */ void SetPartName(const QString& partName) override; /** * Checks that the given site is valid for this type of part. * The site for an editor must be anIEditorSite
.
*
* @param site the site to check
* @since 3.1
*/
void CheckSite(IWorkbenchPartSite::Pointer site) override;
public:
/* (non-Javadoc)
* Saves the contents of this editor.
*
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see IEditorPart
*
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see IEditorPart
*
* Subclasses of EditorPart
must implement this method. Within
* the implementation subclasses should verify that the input type is acceptable
* and then save the site and input. Here is sample code:
*
* if (!(input instanceof IFileEditorInput)) * throw new PartInitException("Invalid Input: Must be IFileEditorInput"); * setSite(site); * setInput(input); **/ void Init(IEditorSite::Pointer site, IEditorInput::Pointer input) override = 0; /* (non-Javadoc) * Returns whether the contents of this editor have changed since the last save * operation. *
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see IEditorPart
*
* Subclasses must override this method to implement the open-save-close lifecycle
* for an editor. For greater details, see IEditorPart
*
* This method returns true
if and only if the editor is dirty
* (isDirty
).
*
* Within the workbench each part, editor or view, has a private set of action * bars. This set, which contains a menu, toolbar, and status line, appears * in the local toolbar for a view and in the window for an editor. The view * may provide an implementation for pre-existing actions or add new actions to * the action bars. *
* A part may also contribute new actions to the action bars as required. To do
* this, call GetMenuManager
, GetToolBarManager
, or
* GetStatusLineManager
as appropriate to get the action target.
* Add the action(s) to the target and call update
to commit
* any changes to the underlying widgets.
*
* This interface is not intended to be implemented by clients. *
- * @noimplement This interface is not intended to be implemented by clients. */ struct IActionBars : public Object { berryObjectMacro(berry::IActionBars); /** * Returns the menu manager. *
* Note: Clients who add or remove items from the returned menu manager are
* responsible for calling updateActionBars
so that the changes
* can be propagated throughout the workbench.
*
null
.
*/
virtual IServiceLocator* GetServiceLocator() = 0;
/**
* Returns the status line manager.
*
* Note: Clients who add or remove items from the returned status line
* manager are responsible for calling updateActionBars
so
* that the changes can be propagated throughout the workbench.
*
* Note: Clients who add or remove items from the returned tool bar manager are
* responsible for calling updateActionBars
so that the changes
* can be propagated throughout the workbench.
*
* Clients who add or remove items from the menu, tool bar, or status line * managers, or that update global action handlers, should call this method * to propagated the changes throughout the workbench. *
*/ virtual void UpdateActionBars() = 0; }; } #endif // BERRYIACTIONBARS_H diff --git a/Plugins/org.blueberry.ui.qt/src/berryIContextService.h b/Plugins/org.blueberry.ui.qt/src/berryIContextService.h index eefd65c018..febb4813e4 100644 --- a/Plugins/org.blueberry.ui.qt/src/berryIContextService.h +++ b/Plugins/org.blueberry.ui.qt/src/berryIContextService.h @@ -1,378 +1,378 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef BERRYICONTEXTSERVICE_H #define BERRYICONTEXTSERVICE_H #include "berryIServiceWithSources.h" namespace berry { struct IContextActivation; struct IContextManagerListener; class Context; class Expression; class Shell; /** ** Provides services related to contexts in the blueberry workbench. This provides * access to contexts. *
** This service can be acquired from your service locator: *
* IContextService service = (IContextService) getSite().getService(IContextService.class); **
EnabledSubmission
instances for the
* "In Dialogs" or "In Windows" contexts.
*
*/
TYPE_NONE = 1,
/**
* The type used for registration indicating that the shell should be
* treated as a window. When the given shell is active, the "In Windows"
* context should also be active.
*/
TYPE_WINDOW = 2
};
/**
* * Activates the given context within the context of this service. If this * service was retrieved from the workbench, then this context will be * active globally. If the service was retrieved from a nested component, * then the context will only be active within that component. *
*
* Also, it is guaranteed that the contexts submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a IWorkbenchPartSite
* would deactivate all of its contexts when the site is destroyed.
*
null
.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*/
virtual SmartPointer
* Activates the given context within the context of this service. The
* context becomes active when expression
evaluates to
* true
. This is the same as calling
- * {@link #activateContext(String, Expression, boolean)} with global==false
.
+ * {@link #ActivateContext} with global==false
.
*
* Also, it is guaranteed that the context submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a IWorkbenchPartSite
* would deactivate all of its handlers when the site is destroyed.
*
null
.
* @param expression
* This expression must evaluate to true
before
* this context will really become active. The expression may be
* null
if the context should always be active.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*
* @see ISources
*/
virtual SmartPointer
* Activates the given context within the context of this service. The
* context becomes active when expression
evaluates to
* true
. If global==false
then this service
* must also be the active service to activate the context.
*
* Also, it is guaranteed that the context submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a IWorkbenchPartSite
* would deactivate all of its handlers when the site is destroyed.
*
null
.
* @param expression
* This expression must evaluate to true
before
* this context will really become active. The expression may be
* null
if the context should always be active.
* @param global
* Indicates that the handler should be activated irrespectively
* of whether the corresponding workbench component (e.g.,
* window, part, etc.) is active.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*
* @see ISources
*/
virtual SmartPointer* Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param listener * The listener to attach; must not benull
.
* @see RemoveContextManagerListener(IContextManagerListener*)
*/
virtual void AddContextManagerListener(IContextManagerListener* listener) = 0;
/**
* Deactivates the given context within the context of this service. If the
* handler was context with a different service, then it must be deactivated
* from that service instead. It is only possible to retract a context
* activation with this method. That is, you must have the same
* IContextActivation
used to activate the context.
*
* @param activation
* The token that was returned from a call to
* activateContext
; must not be null
.
*/
virtual void DeactivateContext(const SmartPointerIContextActivation
instances used to activate the
* contexts.
*
* @param activations
* The tokens that were returned from a call to
* activateContext
. This collection must only
* contain instances of IContextActivation
. The
* collection must not be null
.
*/
virtual void DeactivateContexts(const QListnull
if no active contexts have been set yet. If
* the set is not null
, then it contains only
* instances of String
.
*/
virtual QListnull
.
* @return A context with the given identifier, either defined or undefined.
*/
virtual SmartPointerContext
) that are
* defined; never null
, but may be empty.
*/
virtual QListString
)
* that are defined; never null
, but may be empty.
*/
virtual QListnull
, then
* IContextService.TYPE_NONE
is returned.
* @return IContextService.TYPE_WINDOW
,
* IContextService.TYPE_DIALOG
, or
* IContextService.TYPE_NONE
.
*/
virtual ShellType GetShellType(const SmartPointer* Reads the context information from the registry and the preferences. This * will overwrite any of the existing information in the context service. * This method is intended to be called during start-up. When this method * completes, this context service will reflect the current state of the * registry and preference store. *
*/ virtual void ReadRegistry() = 0; /** ** Registers a shell to automatically promote or demote some basic types of * contexts. The "In Dialogs" and "In Windows" contexts are provided by the * system. This a convenience method to ensure that these contexts are * promoted when the given is shell is active. *
** If a shell is registered as a window, then the "In Windows" context is * enabled when that shell is active. If a shell is registered as a dialog -- * or is not registered, but has a parent shell -- then the "In Dialogs" * context is enabled when that shell is active. If the shell is registered * as none -- or is not registered, but has no parent shell -- then the * neither of the contexts will be enabled (by us -- someone else can always * enabled them). *
** If the provided shell has already been registered, then this method will * change the registration. *
* * @param shell * The shell to register for key bindings; must not be *null
.
* @param type
* The type of shell being registered. This value must be one of
* the constants given in this interface.
*
* @return true
if the shell had already been registered
* (i.e., the registration has changed); false
* otherwise.
*/
virtual bool RegisterShell(const SmartPointernull
.
*/
virtual void RemoveContextManagerListener(IContextManagerListener* listener) = 0;
/**
* * Unregisters a shell that was previously registered. After this method * completes, the shell will be treated as if it had never been registered * at all. If you have registered a shell, you should ensure that this * method is called when the shell is disposed. Otherwise, a potential * memory leak will exist. *
*
* If the shell was never registered, or if the shell is
* Note: You must insure that if you call
*
* An editor descriptor typically represents one of three types of editors:
* null
,
* then this method returns false
and does nothing.
*
* @param shell
* The shell to be unregistered; does nothing if this value is
* null
.
*
* @return true
if the shell had been registered;
* false
otherwise.
*/
virtual bool UnregisterShell(const SmartPointerdeferUpdates(true)
that nothing in your batched operation
* will prevent the matching call to deferUpdates(false)
.
*
*
*
* This interface is not intended to be implemented or extended by clients. *
* * @see IEditorRegistry - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IEditorDescriptor : public IWorkbenchPartDescriptor { berryObjectMacro(berry::IEditorDescriptor); ~IEditorDescriptor() override; /** * Returns the editor id. ** For internal editors, this is the extension id as defined in the workbench * registry; for external editors, it is path and file name of the external * program. *
* * @return the id of the editor */ QString GetId() const override = 0; /** * Returns the descriptor of the image for this editor. * * @return the descriptor of the image to display next to this editor */ //ImageDescriptor getImageDescriptor() = 0; /** * Returns the label to show for this editor. * * @return the editor label */ QString GetLabel() const override = 0; /** * Returns whether this editor descriptor will open a regular editor * part inside the editor area. * * @returntrue
if editor is inside editor area, and
* false
otherwise
* @since 3.0
*/
virtual bool IsInternal() const = 0;
/**
* Returns whether this editor descriptor will open an external
* editor in-place inside the editor area.
*
* @return true
if editor is in-place, and false
* otherwise
* @since 3.0
*/
virtual bool IsOpenInPlace() const = 0;
/**
* Returns whether this editor descriptor will open an external editor
* in a new window outside the workbench.
*
* @return true
if editor is external, and false
* otherwise
* @since 3.0
*/
virtual bool IsOpenExternal() const = 0;
/**
* Returns the editor matching strategy object for editors
* represented by this editor descriptor, or null
* if there is no explicit matching strategy specified.
*
* @return the editor matching strategy, or null
if none
* @since 3.1
*/
virtual IEditorMatchingStrategy::Pointer GetEditorMatchingStrategy() = 0;
};
}
#endif /*BERRYIEDITORDESCRIPTOR_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h
index 3e763cf436..01403f4075 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorMatchingStrategy.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORMATCHINGSTRATEGY_H_
#define BERRYIEDITORMATCHINGSTRATEGY_H_
#include
* Implementations should inspect the given editor input first,
* and try to reject it early before calling IEditorReference.getEditorInput()
,
* since that method may be expensive.
*
true
if the editor matches the given editor input,
* false
if it does not match
*/
virtual bool Matches(IEditorReference::Pointer editorRef, IEditorInput::Pointer input) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IEditorMatchingStrategy, "org.blueberry.ui.IEditorMatchingStrategy")
#endif /*BERRYIEDITORMATCHINGSTRATEGY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h
index 1a99febfc8..5b5fa78333 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorPart.h
@@ -1,127 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORPART_H_
#define BERRYIEDITORPART_H_
#include "berryIWorkbenchPart.h"
#include "berryISaveablePart.h"
#include IEditorInput
. Modifications made
* in an editor part follow an open-save-close lifecycle model (in contrast
* to a view part, where modifications are saved to the workbench
* immediately).
* * An editor is document or input-centric. Each editor has an input, and only * one editor can exist for each editor input within a page. This policy has * been designed to simplify part management. *
* An editor should be used in place of a view whenever more than one instance * of a document type can exist. *
* This interface may be implemented directly. For convenience, a base
* implementation is defined in EditorPart
.
*
* An editor part is added to the workbench in two stages: *
* All editor parts implement the IAdaptable
interface; extensions
* are managed by the platform's adapter manager.
*
getEditorInput
.
*/
//static const int PROP_INPUT = IWorkbenchPartConstants.PROP_INPUT;
/**
* Returns the input for this editor. If this value changes the part must
* fire a property listener event with PROP_INPUT
.
*
* @return the editor input
*/
virtual SmartPointer(IEditorSite) getSite()
.
*
* The site can be null
while the editor is being initialized.
* After the initialization is complete, this value must be non-null
* for the remainder of the editor's life cycle.
*
null
if the editor
* has not yet been initialized
*/
virtual SmartPointer* This method is automatically called shortly after the part is instantiated. - * It marks the start of the part's lifecycle. The - * {@link IWorkbenchPart#dispose IWorkbenchPart.dispose} method will be called - * automically at the end of the lifecycle. Clients must not call this method. + * It marks the start of the part's lifecycle. Clients must not call this method. *
* Implementors of this method must examine the editor input object type to
* determine if it is understood. If not, the implementor must throw
* a PartInitException
*
* An editor can be created in one of two ways: *
* The registry does not keep track of editors that are "implicitly" determined.
* For example a bitmap (.bmp
) file will typically not have a
* registered editor. Instead, when no registered editor is found, the
* underlying OS is consulted.
*
* This interface is not intended to be implemented by clients. *
* * @see org.blueberry.ui.IWorkbench#getEditorRegistry() - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IEditorRegistry { /** * The property identifier for the contents of this registry. */ static const int PROP_CONTENTS; // = 0x01; /** * The identifier for the system external editor descriptor. This descriptor * is always present in the registry on all platforms. - * This editor requires an input which implements - * {@link org.blueberry.ui.IPathEditorInput IPathEditorInput}. - * Use {@link #findEditor findEditor} to access the editor descriptor for - * this identifier. + * Use {@link #FindEditor} to access the editor descriptor for this identifier. * * @since 3.0 */ static const QString SYSTEM_EXTERNAL_EDITOR_ID; // = "org.blueberry.ui.systemExternalEditor"; /** * The identifier for the system in-place editor descriptor. This descriptor * is only present in the registry on platforms that support in-place editing - * (for example Win32). This editor requires an input which implements - * {@link org.blueberry.ui.IInPlaceEditorInput IInPlaceEditorInput}. Use - * {@link #findEditor findEditor} to access the editor descriptor for this - * identifier. + * (for example Win32). Use {@link #FindEditor} to access the editor + * descriptor for this identifier. * * @since 3.0 */ static const QString SYSTEM_INPLACE_EDITOR_ID; // = "org.blueberry.ui.systemInPlaceEditor"; /* * Adds a listener for changes to properties of this registry. * Has no effect if an identical listener is already registered. ** The properties ids are as follows: *
PROP_CONTENTS
: Triggered when the file editor mappings in
* the editor registry change.null
if not
* found
*/
virtual IEditorDescriptor::Pointer FindEditor(const QString& editorId) = 0;
/**
* Returns the default editor. The default editor always exist.
*
* @return the descriptor of the default editor
* @deprecated The system external editor is the default editor.
* Use findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)
* instead.
*/
virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
/**
* Returns the default editor for a given file name. This method assumes an
* unknown content type for the given file.
* * The default editor is determined by taking the file extension for the * file and obtaining the default editor for that extension. *
* * @param fileName * the file name in the system * @return the descriptor of the default editor, ornull
if
* not found
*/
virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName) = 0;
/*
* Returns the default editor for a given file name and with the given content type.
* * The default editor is determined by taking the file extension for the * file and obtaining the default editor for that extension. *
* * @param fileName the file name in the system * @param contentType the content type ornull
for the unknown content type
* @return the descriptor of the default editor, or null
if not
* found
* @since 3.1
*/
//virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) = 0;
/**
* Returns the list of file editors registered to work against the file with
* the given file name. This method assumes an unknown content type for the
* given file.
*
* Note: Use getDefaultEditor(String)
if you only the need
* the default editor rather than all candidate editors.
*
* Note: Use getDefaultEditor(String)
if you only the need
* the default editor rather than all candidate editors.
*
null
for the unknown
* content type
* @return a list of editor descriptors
* @since 3.1
*/
//virtual QList* Each mapping defines an extension and the set of editors that are * available for that type. The set of editors includes those registered * via plug-ins and those explicitly associated with a type by the user * in the workbench preference pages. *
* * @return a list of mappings sorted alphabetically by extension */ virtual QList* The image is determined by taking the file extension of the file and * obtaining the image for the default editor associated with that * extension. A default image is returned if no default editor is available. *
* * @param filename * the file name in the system * @return the descriptor of the image to display next to the file */ // virtual ImageDescriptor* GetImageDescriptor(const QString& filename) = 0; /* * Returns the image descriptor associated with a given file. This image is * usually displayed next to the given file. ** The image is determined by taking the file extension of the file and * obtaining the image for the default editor associated with that * extension. A default image is returned if no default editor is available. *
* * @param filename * the file name in the system * @param contentType * the content type of the file ornull
for the
* unknown content type
* @return the descriptor of the image to display next to the file
* @since 3.1
*/
// virtual ImageDescriptor* GetImageDescriptor(const std::tring& filename, IContentType contentType) = 0;
/*
* Removes the given property listener from this registry.
* Has no affect if an identical listener is not registered.
*
* @param listener a property listener
*/
// virtual void RemovePropertyListener(IPropertyListener listener) = 0;
/**
* Sets the default editor id for the files that match that
* specified file name or extension. The specified editor must be
* defined as an editor for that file name or extension.
*
* @param fileNameOrExtension the file name or extension pattern (e.g. "*.xml");
* @param editorId the editor id or null
for no default
*/
virtual void SetDefaultEditor(const QString& fileNameOrExtension, const QString& editorId) = 0;
/**
* Returns whether there is an in-place editor that could handle a file
* with the given name.
*
* @param filename the file name
* @return true
if an in-place editor is available, and
* false
otherwise
* @since 3.0
*/
virtual bool IsSystemInPlaceEditorAvailable(const QString& filename) = 0;
/**
* Returns whether the system has an editor that could handle a file
* with the given name.
*
* @param filename the file name
* @return true
if an external editor available, and
* false
otherwise
* @since 3.0
*/
virtual bool IsSystemExternalEditorAvailable(const QString& filename) = 0;
/*
* Returns the image descriptor associated with the system editor that
* would be used to edit this file externally.
*
* @param filename the file name
* @return the descriptor of the external editor image, or null
* if none
* @since 3.0
*/
// virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const QString& filename) = 0;
};
}
#endif /*MITKIEDITORREGISTRY_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h b/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
index e9a8d79052..f04095c4df 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIEditorSite.h
@@ -1,129 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEDITORSITE_H_
#define BERRYIEDITORSITE_H_
#include "berryIWorkbenchPartSite.h"
namespace berry {
/**
* \ingroup org_blueberry_ui_qt
*
* The primary interface between an editor part and the workbench.
* * The workbench exposes its implemention of editor part sites via this * interface, which is not intended to be implemented or extended by clients. *
- * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IEditorSite : public virtual IWorkbenchPartSite { berryObjectMacro(berry::IEditorSite); ~IEditorSite() override; /** * Returns the action bar contributor for this editor. ** An action contributor is responsable for the creation of actions. * By design, this contributor is used for one or more editors of the same type. * Thus, the contributor returned by this method is not owned completely * by the editor - it is shared. *
* * @return the editor action bar contributor, ornull
if none exists
*/
//virtual IEditorActionBarContributor getActionBarContributor();
/**
* Returns the action bars for this part site. Editors of the same type (and
* in the same window) share the same action bars. Contributions to the
* action bars are done by the IEditorActionBarContributor
.
*
* @return the action bars
* @since 2.1
*/
//virtual IActionBars getActionBars();
/**
* * Registers a pop-up menu with the default id for extension. The default id * is defined as the part id. *
*
* By default, context menus include object contributions based on the
* editor input for the current editor. It is possible to override this
* behaviour by calling this method with includeEditorInput
* as false
. This might be desirable for editors that
* present a localized view of an editor input (e.g., a node in a model
* editor).
*
* For a detailed description of context menu registration see * {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)} *
* * @param menuManager * the menu manager; must not benull
.
* @param selectionProvider
* the selection provider; must not be null
.
* @param includeEditorInput
* Whether the editor input should be included when adding object
* contributions to this context menu.
* @see IWorkbenchPartSite#registerContextMenu(MenuManager,
* ISelectionProvider)
* @since 3.1
*/
// virtual void registerContextMenu(MenuManager menuManager,
// ISelectionProvider selectionProvider, boolean includeEditorInput);
/**
* * Registers a pop-up menu with a particular id for extension. This method * should only be called if the target part has more than one context menu * to register. *
*
* By default, context menus include object contributions based on the
* editor input for the current editor. It is possible to override this
* behaviour by calling this method with includeEditorInput
* as false
. This might be desirable for editors that
* present a localized view of an editor input (e.g., a node in a model
* editor).
*
* For a detailed description of context menu registration see * {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)} *
* * @param menuId * the menu id; must not benull
.
* @param menuManager
* the menu manager; must not be null
.
* @param selectionProvider
* the selection provider; must not be null
.
* @param includeEditorInput
* Whether the editor input should be included when adding object
* contributions to this context menu.
* @see IWorkbenchPartSite#registerContextMenu(MenuManager,
* ISelectionProvider)
* @since 3.1
*/
// virtual void registerContextMenu(String menuId, MenuManager menuManager,
// ISelectionProvider selectionProvider, boolean includeEditorInput);
};
}
#endif /*BERRYIEDITORSITE_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/berryIElementFactory.h b/Plugins/org.blueberry.ui.qt/src/berryIElementFactory.h
index e71211cf2b..4105bba7fd 100644
--- a/Plugins/org.blueberry.ui.qt/src/berryIElementFactory.h
+++ b/Plugins/org.blueberry.ui.qt/src/berryIElementFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIELEMENTFACTORY_H
#define BERRYIELEMENTFACTORY_H
#include
* Clients should implement this interface and include the name of their class
* in an extension to the platform extension point named
* "org.blueberry.ui.elementFactories"
.
* For example, the plug-in's XML markup might contain:
- *
- * <extension point="org.blueberry.ui.elementFactories"> - * <factory id="com.example.myplugin.MyFactory" class="MyFactory" /> - * </extension> - *+ * \code{.unparsed} + *
* If the result is not null, it should be persistable; that is, *
* result.getAdapter(org.eclipse.ui.IPersistableElement.class) ** should not return
null
. The caller takes ownership of the
* result and must delete it when it is not needed any more.
*
*
* @param memento
* a memento containing the state for the object
* @return an object, or nullptr
if the element could not be
* created
*/
virtual IAdaptable* CreateElement(const SmartPointer* The name and extension can never empty or null. The name may contain * the single wild card character (*) to indicate the editor applies to * all files with the same extension (e.g. *.doc). The name can never * embed the wild card character within itself (i.e. rep*) *
** This interface is not intended to be implemented by clients. *
* - * @see IEditorRegistry#getFileEditorMappings - * @noimplement This interface is not intended to be implemented by clients. + * @see IEditorRegistry#GetFileEditorMappings */ struct BERRY_UI_QT IFileEditorMapping : public Object { berryObjectMacro(berry::IFileEditorMapping); ~IFileEditorMapping() override; /** * Returns the default editor registered for this type mapping. * * @return the descriptor of the default editor, ornull
if there
* is no default editor registered. Will also return null
if
* the default editor exists but fails the Expressions check.
*/
virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
/**
* Returns the list of editors registered for this type mapping.
*
* @return a possibly empty list of editors.
*/
virtual QList* The image is obtained from the default editor. A default file image is * returned if no default editor is available. *
* * @return the descriptor of the image to use for a resource of this type */ //virtual ImageDescriptor GetImageDescriptor() = 0; /** * Returns the label to use for this mapping. * Labels have the form "IFolderLayout
is used to define the initial views within a folder.
* The folder itself is contained within an IPageLayout
.
* * This interface is not intended to be implemented by clients. *
* * @see IPageLayout#createFolder - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IFolderLayout : public IPlaceholderFolderLayout { berryObjectMacro(berry::IFolderLayout); ~IFolderLayout() override; /** * Adds a view with the given compound id to this folder. * See the {@link IPageLayout} type documentation for more details about compound ids. * The primary id must name a view contributed to the workbench's view extension point * (named"org.blueberry.ui.views"
).
*
* @param viewId the view id
*/
virtual void AddView(const QString& viewId) = 0;
};
}
#endif /*BERRYIFOLDERLAYOUT_H_*/
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h
index 0d18b6cd79..37b3ebc6b5 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandImageService.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICOMMANDIMAGESERVICE_H_
#define BERRYICOMMANDIMAGESERVICE_H_
#include "../services/berryIDisposable.h"
#include * Provides a look-up facility for images associated with commands. *
*
* The type of an image indicates the state of the associated command
* within the user interface. The supported types are: TYPE_DEFAULT
* (to be used for an enabled command), TYPE_DISABLED
(to be used
* for a disabled command) and TYPE_HOVER
(to be used for an
* enabled command over which the mouse is hovering).
*
* The style of an image is an arbitrary string used to distinguish * between sets of images associated with a command. For example, a command may * appear in the menus as the default style. However, in the toolbar, the * command is simply the default action for a toolbar drop down item. As such, * perhaps a different image style is appropriate. The classic case is the "Run * Last Launched" command, which appears in the menu and the toolbar, but with * different icons in each location. *
** We currently support a default image style (none) and an image style of * IMAGE_STYLE_TOOLBAR. *
* - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. + * @note This interface is not intended to be implemented by clients. + * @note This interface is not intended to be extended by clients. * */ struct BERRY_UI_QT ICommandImageService : public IDisposable { berryObjectMacro(berry::ICommandImageService); /** * The default image style. This is provided when no style is requested or * when the requested style is unavailable. (Value is null) */ static const QString IMAGE_STYLE_DEFAULT; /** * The image style used for commands in a toolbar. This is useful if you * want the icon for the command in the toolbar to be different than the one * that is displayed with menu items. (Value is toolbar) */ static const QString IMAGE_STYLE_TOOLBAR; // = "toolbar"; /** * Retrieves the image associated with the given command in the * default style. * * @param commandId * The identifier to find; must not benull
.
* @return An image appropriate for the given command; may be
* null
.
*/
virtual QIcon GetImage(const QString& commandId) = 0;
/**
* Retrieves the image associated with the given command in the
* given style.
*
* @param commandId
* The identifier to find; must not be null
.
* @param style
* The style of the image to retrieve; may be null
.
* @return An image appropriate for the given command; A null QIcon
* if the given image style cannot be found.
*/
virtual QIcon GetImage(const QString& commandId, const QString& style) = 0;
};
}
Q_DECLARE_INTERFACE(berry::ICommandImageService, "org.blueberry.ui.ICommandImageService")
#endif /* BERRYICOMMANDIMAGESERVICE_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h
index 45ed978431..da1c9041b6 100644
--- a/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h
+++ b/Plugins/org.blueberry.ui.qt/src/commands/berryICommandService.h
@@ -1,372 +1,372 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYICOMMANDSERVICE_H_
#define BERRYICOMMANDSERVICE_H_
#include "../services/berryIDisposable.h"
#include * Provides services related to the command architecture within the workbench. * This service can be used to access the set of commands and command * categories. *
** This service can be acquired from your service locator: *
* ICommandService service = (ICommandService) getSite().getService(ICommandService.class); **
null
.
*/
static const QString AUTOGENERATED_CATEGORY_ID();
/**
* Adds an execution listener to the command service. This listener will be
* notified as commands are executed.
* * Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param listener * The listener to add; must not benull
.
- * @see #removeExecutionListener(IExecutionListener)
+ * @see #RemoveExecutionListener
*/
virtual void AddExecutionListener(IExecutionListener* listener) = 0;
/**
* Sets the name and description of the category for uncategorized commands.
* This is the category that will be returned if
- * {@link #getCategory(String)} is called with null
.
+ * {@link #GetCategory} is called with null
.
*
* @param name
* The name of the category for uncategorized commands; must not
* be null
.
* @param description
* The description of the category for uncategorized commands;
* may be null
.
*/
virtual void DefineUncategorizedCategory(const QString& name, const QString& description) = 0;
/**
*
* Returns a {@link ParameterizedCommand} with a command and
* parameterizations as specified in the provided
* serializedParameterizedCommand
string. The
* serializedParameterizedCommand
must use the format
- * returned by {@link ParameterizedCommand#serialize()} and described in the
+ * returned by {@link ParameterizedCommand#Serialize} and described in the
* Javadoc for that method.
*
* If a parameter id encoded in the
* serializedParameterizedCommand
does not exist in the
* encoded command, that parameter id and value are ignored. A given
* parameter id should not be used more than once in
* serializedParameterizedCommand
. This will not result in
* an exception, but the value of the parameter when the command is executed
* cannot be specified here.
*
* This method will never return null
, however it may throw
* an exception if there is a problem processing the serialization string or
* the encoded command is undefined.
*
String
representing a command id and
* parameter ids and values
* @return a ParameterizedCommand
with the command and
* parameterizations encoded in the
* serializedParameterizedCommand
* @throws NotDefinedException
* if the command indicated in
* serializedParameterizedCommand
is not defined
* @throws SerializationException
* if there is an error deserializing
* serializedParameterizedCommand
* @see ParameterizedCommand#serialize()
* @see CommandManager#deserialize(String)
*/
virtual SmartPointernull
,
* then a category suitable for uncategorized items is defined
* and returned.
* @return A category with the given identifier, either defined or
* undefined.
*/
virtual SmartPointernull
.
* @return A command with the given identifier, either defined or undefined.
*/
virtual SmartPointerCategory
) that are
* defined; never null
, but may be empty.
*/
virtual QListString
)
* that are defined; never null
, but may be empty.
*/
virtual QStringList GetDefinedCategoryIds() const = 0;
/**
* Returns the collection of the identifiers for all of the defined commands
* in the workbench.
*
* @return The collection of command identifiers (String
)
* that are defined; never null
, but may be empty.
*/
virtual QStringList GetDefinedCommandIds() const = 0;
/**
* Returns the collection of all of the defined commands in the workbench.
*
* @return The collection of commands (Command
) that are
* defined; never null
, but may be empty.
*/
virtual QListString
)
* that are defined; never null
, but may be empty.
*/
virtual QStringList GetDefinedParameterTypeIds() const = 0;
/**
* Returns the collection of all of the defined command parameter types in
* the workbench.
*
* @return The collection of command parameter types (ParameterType
)
* that are defined; never null
, but may be empty.
*/
virtual QListnull
is returned.
*
* @param command
* The command for which the help context should be retrieved;
* must not be null
.
* @return The help context identifier to use for the given command; may be
* null
.
* @throws NotDefinedException
* If the given command is not defined.
*/
virtual QString GetHelpContextId(const SmartPointernull
is returned.
*
* @param commandId
* The identifier of the command for which the help context
* should be retrieved; must not be null
.
* @return The help context identifier to use for the given command; may be
* null
.
* @throws NotDefinedException
* If the command with the given identifier is not defined.
*/
virtual QString GetHelpContextId(const QString& commandId) const = 0;
/**
* Retrieves the command parameter type with the given identifier. If no
* such parameter type exists, then an undefined parameter type with the
* given id is created.
*
* @param parameterTypeId
* The identifier to find; must not be null
.
* @return A command parameter type with the given identifier, either
* defined or undefined.
*/
virtual SmartPointer* Reads the command information from the registry and the preferences. This * will overwrite any of the existing information in the command service. * This method is intended to be called during start-up. When this method * completes, this command service will reflect the current state of the * registry and preference store. *
*/ virtual void ReadRegistry() = 0; /** * Removes an execution listener from the command service. * * @param listener * The listener to remove; must not benull
.
*/
virtual void RemoveExecutionListener(IExecutionListener* listener) = 0;
/**
* Sets the help context identifier to associate with a particular handler.
*
* @param handler
* The handler with which to register a help context identifier;
* must not be null
.
* @param helpContextId
* The help context identifier to register; may be
* null
if the help context identifier should be
* removed.
*/
virtual void SetHelpContextId(const SmartPointer* Note: elements should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param command * The parameterized command that is already specialized. Must * not benull
.
* @param element
* The callback to register for this specialized command
* instance. Must not be null
.
* @return A reference for the registered element that can be used to
* unregister it.
* @throws NotDefinedException
* If the command included in the ParameterizedCommand is not
* defined, or the element is null
.
- * @see #unregisterElement(IElementReference)
+ * @see #UnregisterElement
*/
virtual SmartPointer* Note: elements should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param elementReference * The reference to re-register. Must not benull
.
- * @see #unregisterElement(IElementReference)
+ * @see #UnregisterElement
*/
virtual void RegisterElement(const SmartPointernull
.
*/
virtual void UnregisterElement(const SmartPointer* The service locator used in registering the element can also be used to * scope the search. For example: if you wanted all elements for your * command but only within the part's workbench window, you could use: * *
* Map filter = new HashMap(); * filter.put(IServiceScopes.WINDOW_SCOPE, getSite().getPage() * .getWorkbenchWindow()); * commandService.refreshElements(commandId, filter); ** * * * @param commandId * The command id to refresh if it has registered eleemnts. * @param filter * key-value pairs that can narrow down the callbacks to return. * The parameters are ANDed together. This may be *
null
.
*/
virtual void RefreshElements(const QString& commandId, const QHash* Note: this class should not be instantiated or extended by clients. *
* * @since 3.3 */ class BERRY_UI_QT HandlerUtil { private: static void NoVariableFound(const ExecutionEvent::ConstPointer& event, const QString& name); static void IncorrectTypeFound(const ExecutionEvent::ConstPointer& event, const QString& name, const QString& expectedType, const QString& wrongType); public: typedef ObjectListnull
* if it could not be found.
*/
static Object::ConstPointer GetVariable(const ExecutionEvent::ConstPointer& event, const QString& name);
/**
* Extract the variable.
*
* @param event
* The execution event that contains the application context
* @param name
* The variable name to extract.
* @return The object from the application context. Will not return
* null
.
* @throws ExecutionException
* if the variable is not found.
*/
static Object::ConstPointer GetVariableChecked(const ExecutionEvent::ConstPointer& event, const QString& name);
/**
* Extract the variable.
*
* @param context
* The IEvaluationContext or null
* @param name
* The variable name to extract.
* @return The object from the application context, or null
* if it could not be found.
*/
static Object::ConstPointer GetVariable(Object::Pointer context, const QString& name);
/**
* Return the active contexts.
*
* @param event
* The execution event that contains the application context
* @return a collection of String contextIds, or null
.
*/
static StringVectorType::ConstPointer GetActiveContexts(const ExecutionEvent::ConstPointer& event);
/**
* Return the active contexts.
*
* @param event
* The execution event that contains the application context
* @return a collection of String contextIds. Will not return
* null
.
* @throws ExecutionException
* If the context variable is not found.
*/
static StringVectorType::ConstPointer GetActiveContextsChecked(const ExecutionEvent::ConstPointer& event);
- /**
- * Return the active shell. Is not necessarily the active workbench window
- * shell.
- *
- * @param event
- * The execution event that contains the application context
- * @return the active shell, or null
.
- */
-// static Shell GetActiveShell(const ExecutionEvent::ConstPointer& event) {
-// Object::Pointer o = getVariable(event, ISources.ACTIVE_SHELL_NAME);
-// if (o instanceof Shell) {
-// return (Shell) o;
-// }
-// return null;
-// }
-
- /**
- * Return the active shell. Is not necessarily the active workbench window
- * shell.
- *
- * @param event
- * The execution event that contains the application context
- * @return the active shell. Will not return null
.
- * @throws ExecutionException
- * If the active shell variable is not found.
- */
-// static Shell GetActiveShellChecked(const ExecutionEvent::ConstPointer& event)
-// {
-// Object::Pointer o = getVariableChecked(event, ISources.ACTIVE_SHELL_NAME);
-// if (!(o instanceof Shell)) {
-// incorrectTypeFound(event, ISources.ACTIVE_SHELL_NAME, Shell.class,
-// o.getClass());
-// }
-// return (Shell) o;
-// }
-
/**
* Return the active workbench window.
*
* @param event
* The execution event that contains the application context
* @return the active workbench window, or null
.
*/
static IWorkbenchWindow::Pointer GetActiveWorkbenchWindow(const ExecutionEvent::ConstPointer& event);
/**
* Return the active workbench window.
*
* @param event
* The execution event that contains the application context
* @return the active workbench window. Will not return null
.
* @throws ExecutionException
* If the active workbench window variable is not found.
*/
static IWorkbenchWindow::Pointer GetActiveWorkbenchWindowChecked(
const ExecutionEvent::ConstPointer& event);
- /**
- * Return the active editor.
- *
- * @param event
- * The execution event that contains the application context
- * @return the active editor, or null
.
- */
- //static IEditorPart::Pointer GetActiveEditor(const ExecutionEvent::ConstPointer& event);
-
- /**
- * Return the active editor.
- *
- * @param event
- * The execution event that contains the application context
- * @return the active editor. Will not return null
.
- * @throws ExecutionException
- * If the active editor variable is not found.
- */
- //static IEditorPart::Pointer GetActiveEditorChecked(const ExecutionEvent::ConstPointer& event);
-
/**
* Return the part id of the active editor.
*
* @param event
* The execution event that contains the application context
* @return the part id of the active editor, or null
.
*/
static ObjectString::ConstPointer GetActiveEditorId(const ExecutionEvent::ConstPointer& event);
/**
* Return the part id of the active editor.
*
* @param event
* The execution event that contains the application context
* @return the part id of the active editor. Will not return
* null
.
* @throws ExecutionException
* If the active editor id variable is not found.
*/
static ObjectString::ConstPointer GetActiveEditorIdChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the active part.
*
* @param event
* The execution event that contains the application context
* @return the active part, or null
.
*/
static IWorkbenchPart::Pointer GetActivePart(const ExecutionEvent::ConstPointer& event);
/**
* Return the active part.
*
* @param event
* The execution event that contains the application context
* @return the active part. Will not return null
.
* @throws ExecutionException
* If the active part variable is not found.
*/
static IWorkbenchPart::Pointer GetActivePartChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the part id of the active part.
*
* @param event
* The execution event that contains the application context
* @return the part id of the active part, or null
.
*/
static ObjectString::ConstPointer GetActivePartId(const ExecutionEvent::ConstPointer& event);
/**
* Return the part id of the active part.
*
* @param event
* The execution event that contains the application context
* @return the part id of the active part. Will not return null
.
* @throws ExecutionException
* If the active part id variable is not found.
*/
static ObjectString::ConstPointer GetActivePartIdChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the active part site.
*
* @param event
* The execution event that contains the application context
* @return the active part site, or null
.
*/
static IWorkbenchPartSite::Pointer GetActiveSite(const ExecutionEvent::ConstPointer& event);
/**
* Return the active part site.
*
* @param event
* The execution event that contains the application context
* @return the active part site. Will not return null
.
* @throws ExecutionException
* If the active part site variable is not found.
*/
static IWorkbenchPartSite::Pointer GetActiveSiteChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the current selection.
*
* @param event
* The execution event that contains the application context
* @return the current selection, or null
.
*/
static ISelection::ConstPointer GetCurrentSelection(const ExecutionEvent::ConstPointer& event);
/**
* Return the current selection.
*
* @param event
* The execution event that contains the application context
* @return the current selection. Will not return null
.
* @throws ExecutionException
* If the current selection variable is not found.
*/
static ISelection::ConstPointer GetCurrentSelectionChecked(const ExecutionEvent::ConstPointer& event);
/**
- * Return the menu IDs that were applied to the registered context menu. For
- * example, #CompilationUnitEditorContext.
+ * Return the menu IDs that were applied to the registered context menu.
*
* @param event
* The execution event that contains the application context
* @return the menu IDs, or null
.
*/
static StringVectorType::ConstPointer GetActiveMenus(const ExecutionEvent::ConstPointer& event);
/**
- * Return the menu IDs that were applied to the registered context menu. For
- * example, #CompilationUnitEditorContext.
+ * Return the menu IDs that were applied to the registered context menu.
*
* @param event
* The execution event that contains the application context
* @return the menu IDs. Will not return null
.
* @throws ExecutionException
* If the active menus variable is not found.
*/
static StringVectorType::ConstPointer GetActiveMenusChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the active menu selection. The active menu is a registered context
* menu.
*
* @param event
* The execution event that contains the application context
* @return the active menu selection, or null
.
*/
static ISelection::ConstPointer GetActiveMenuSelection(const ExecutionEvent::ConstPointer& event);
/**
* Return the active menu selection. The active menu is a registered context
* menu.
*
* @param event
* The execution event that contains the application context
* @return the active menu selection. Will not return null
.
* @throws ExecutionException
* If the active menu selection variable is not found.
*/
static ISelection::ConstPointer GetActiveMenuSelectionChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the active menu editor input, if available. The active menu is a
* registered context menu.
*
* @param event
* The execution event that contains the application context
* @return the active menu editor, or null
.
*/
static ISelection::ConstPointer GetActiveMenuEditorInput(const ExecutionEvent::ConstPointer& event);
/**
* Return the active menu editor input. The active menu is a registered
* context menu. Some context menus do not include the editor input which
* will throw an exception.
*
* @param event
* The execution event that contains the application context
* @return the active menu editor input. Will not return null
.
* @throws ExecutionException
* If the active menu editor input variable is not found.
*/
static ISelection::ConstPointer GetActiveMenuEditorInputChecked(
const ExecutionEvent::ConstPointer& event);
/**
* Return the ShowInContext selection.
*
* @param event
* The execution event that contains the application context
* @return the show in selection, or null
.
*/
static ISelection::ConstPointer GetShowInSelection(const ExecutionEvent::ConstPointer& event);
/**
* Return the ShowInContext selection. Will not return null
.
*
* @param event
* The execution event that contains the application context
* @return the show in selection, or null
.
* @throws ExecutionException
* If the show in selection variable is not found.
*/
static ISelection::ConstPointer GetShowInSelectionChecked(const ExecutionEvent::ConstPointer& event);
/**
* Return the ShowInContext input.
*
* @param event
* The execution event that contains the application context
* @return the show in input, or null
.
*/
static Object::ConstPointer GetShowInInput(const ExecutionEvent::ConstPointer& event);
/**
* Return the ShowInContext input. Will not return null
.
*
* @param event
* The execution event that contains the application context
* @return the show in input, or null
.
* @throws ExecutionException
* If the show in input variable is not found.
*/
static Object::ConstPointer GetShowInInputChecked(const ExecutionEvent::ConstPointer& event);
/**
* Toggles the command's state.
*
* @param command The command whose state needs to be toggled
* @return the original value before toggling
*
* @throws ExecutionException
* When the command doesn't contain the toggle state or when the state doesn't contain a boolean value
*/
static bool ToggleCommandState(const SmartPointertrue
whe the values are same, false
* otherwise
*
* @throws ExecutionException
* When the command doesn't have the radio state or the event
* doesn't have the radio state parameter
*/
static bool MatchesRadioState(const SmartPointer* Provides services related to activating and deactivating handlers within the * workbench. *
** This service can be acquired from your service locator: *
* IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class); **
* Activates the given handler from a child service. This is used by slave * and nested services to promote handler activations up to the root. By * using this method, it is possible for handlers coming from a more nested * component to override the nested component. *
* * @param activation * The activation that is local to the child service; must not be *null
.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the service locator
* context from which this service was retrieved is destroyed. This
* activation is local to this service (i.e., it is not the
* activation that is passed as a parameter).
* @since 3.2
*/
virtual SmartPointer* Activates the given handler within the context of this service. If this * service was retrieved from the workbench, then this handler will be * active globally. If the service was retrieved from a nested component, * then the handler will only be active within that component. *
*
* Also, it is guaranteed that the handlers submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a IWorkbenchPartSite
* would deactivate all of its handlers when the site is destroyed.
*
null
.
* @param handler
* The handler to activate; must not be null
.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*/
virtual SmartPointer
* Activates the given handler within the context of this service. The
* handler becomes active when expression
evaluates to
* true
. This is the same as calling
- * {@link #activateHandler(String, IHandler, Expression, boolean)} with
- * global==false.
+ * {@link #ActivateHandler} with \c global==false .
*
* Also, it is guaranteed that the handlers submitted through a particular
* service will be cleaned up when that service is destroyed. So, for
* example, a service retrieved from a IWorkbenchPartSite
* would deactivate all of its handlers when the site is destroyed.
*
null
.
* @param handler
* The handler to activate; must not be null
.
* @param expression
* This expression must evaluate to true
before
* this handler will really become active. The expression may be
* null
if the handler should always be active.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*
* @see org.eclipse.ui.ISources
* @since 3.2
*/
virtual SmartPointer
* Activates the given handler within the context of this service. The
* handler becomes active when expression
evaluates to
* true
. if global==false
, then this
* handler service must also be the active service to active the handler.
* For example, the handler service on a part is active when that part is
* active.
*
* Also, it is guaranteed that the handlers submitted through a particular
* service will be cleaned up when that services is destroyed. So, for
* example, a service retrieved from a IWorkbenchPartSite
* would deactivate all of its handlers when the site is destroyed.
*
null
.
* @param handler
* The handler to activate; must not be null
.
* @param expression
* This expression must evaluate to true
before
* this handler will really become active. The expression may be
* null
if the handler should always be active.
* @param global
* Indicates that the handler should be activated irrespectively
* of whether the corresponding workbench component (e.g.,
* window, part, etc.) is active.
* @return A token which can be used to later cancel the activation. Only
* someone with access to this token can cancel the activation. The
* activation will automatically be cancelled if the context from
* which this service was retrieved is destroyed.
*
* @see org.eclipse.ui.ISources
* @since 3.2
*/
virtual SmartPointernull
.
- * @param event
- * The SWT event triggering the command execution; may be
- * null
.
+ * @param uielement
* @return An execution event suitable for calling
- * {@link Command#executeWithChecks(ExecutionEvent)}.
+ * {@link Command#ExecuteWithChecks}.
* @since 3.2
- * @see Command#executeWithChecks(ExecutionEvent)
+ * @see Command#ExecuteWithChecks
*/
virtual SmartPointernull
.
- * @param event
- * The SWT event triggering the command execution; may be
- * null
.
+ * @param uielement
* @return An execution event suitable for calling
- * {@link Command#executeWithChecks(ExecutionEvent)}.
+ * {@link Command#ExecuteWithChecks}.
* @since 3.2
- * @see ParameterizedCommand#getCommand()
- * @see Command#executeWithChecks(ExecutionEvent)
+ * @see ParameterizedCommand#GetCommand
+ * @see Command#ExecuteWithChecks
*/
virtual SmartPointerIHandlerActivation
used to activate the handler.
*
* @param activation
* The token that was returned from a call to
* activateHandler
; must not be null
.
*/
virtual void DeactivateHandler(const SmartPointerIHandlerActivation
used to activate the handler.
*
* @param activations
* The tokens that were returned from a call to
* activateHandler
. This collection must only
* contain instances of IHandlerActivation
. The
* collection must not be null
.
*/
virtual void DeactivateHandlers(
const QListnull
.
- * @param event
- * The SWT event triggering the command execution; may be
- * null
.
+ * @param uielement
* @return The return value from the execution; may be null
.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
* @since 3.2
- * @see Command#executeWithChecks(ExecutionEvent)
+ * @see Command#ExecuteWithChecks
*/
virtual Object::Pointer ExecuteCommand(const QString& commandId,
const SmartPointernull
.
- * @param event
- * The SWT event triggering the command execution; may be
- * null
.
+ * @param uielement
* @return The return value from the execution; may be null
.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
* @since 3.2
- * @see Command#executeWithChecks(ExecutionEvent)
+ * @see Command#ExecuteWithChecks
*/
virtual Object::Pointer ExecuteCommand(const SmartPointernull
.
- * @param event
- * The SWT event triggering the command execution; may be
- * null
.
+ * @param uielement
* @param context
* the evaluation context to run against. Must not be
* null
* @return The return value from the execution; may be null
.
* @throws ExecutionException
* If the handler has problems executing this command.
* @throws NotDefinedException
* If the command you are trying to execute is not defined.
* @throws NotEnabledException
* If the command you are trying to execute is not enabled.
* @throws NotHandledException
* If there is no handler.
* @since 3.4
- * @see Command#executeWithChecks(ExecutionEvent)
- * @see #createContextSnapshot(boolean)
+ * @see Command#ExecuteWithChecks
+ * @see #CreateContextSnapshot
*/
virtual Object::Pointer ExecuteCommandInContext(
const SmartPointertrue
, include the default variable and
* selection variables
* @return an context filled with the current set of variables. If selection
* is not included, the default variable is an empty collection
*/
virtual SmartPointernull
.
- * @see ParameterizedCommand#executeWithChecks(Object, Object)
- * @see ExecutionEvent#ExecutionEvent(Command, java.util.Map, Object,
- * Object)
- * @see org.eclipse.ui.services.IEvaluationService
+ * @see ParameterizedCommand#ExecuteWithChecks
+ * @see ExecutionEvent#ExecutionEvent
+ * @see IEvaluationService
*/
virtual SmartPointer* Reads the handler information from the registry. This will overwrite any * of the existing information in the handler service. This method is * intended to be called during start-up. When this method completes, this * handler service will reflect the current state of the registry. *
*/ virtual void ReadRegistry() = 0; /** * Sets the help context identifier to associate with a particular handler. * * @param handler * The handler with which to register a help context identifier; * must not benull
.
* @param helpContextId
* The help context identifier to register; may be
* null
if the help context identifier should be
* removed.
* @since 3.2
*/
virtual void SetHelpContextId(const SmartPointer* The initial behavior of the intro part is controlled by the application - * from via the {@link org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()} + * from via the {@link WorkbenchWindowAdvisor#OpenIntro()} * method. *
*- * See {@link org.eclipse.ui.intro.IIntroPart} for details on where intro parts + * See {@link IIntroPart} for details on where intro parts * come from. *
** This interface is not intended to be extended or implemented by clients. *
* * @see org.eclipse.ui.IWorkbench#getIntroManager() * @since 3.0 - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IIntroManager { virtual ~IIntroManager(); /** * Closes the given intro part. * * @param part the intro part * @returntrue
if the intro part was closed, and
* false
otherwise. false
is returned
* if part is null
or it is not the intro part returned
- * by {@link #getIntro()}.
+ * by {@link #GetIntro()}.
*/
virtual bool CloseIntro(IIntroPart::Pointer part) = 0;
/**
* Returns the intro part. Returns null
if there is no intro
- * part, if it has been previously closed via {@link #closeIntro(IIntroPart)}
- * or if there is an intro part but {@link #showIntro(IWorkbenchWindow, boolean)}
+ * part, if it has been previously closed via {@link #CloseIntro}
+ * or if there is an intro part but {@link #ShowIntro}
* has not yet been called to create it.
*
* @return the intro part, or null
if none is available
*/
virtual IIntroPart::Pointer GetIntro() const = 0;
/**
* Return whether an intro is available. Note that this checks whether
* there is an applicable intro part that could be instantiated and shown
* to the user.
- * Use {@link #getIntro()} to discover whether an intro part has already
+ * Use {@link #GetIntro} to discover whether an intro part has already
* been created.
*
* @return true
if there is an intro that could be shown, and
* false
if there is no intro
*/
virtual bool HasIntro() const = 0;
/**
* Return the standby state of the given intro part.
*
* @param part the intro part
* @return true
if the part in its partially
* visible standy mode, and false
if in its fully visible state.
* false
is returned if part is null
or it is not
- * the intro part returned by {@link #getIntro()}.
+ * the intro part returned by {@link #GetIntro}.
*/
virtual bool IsIntroStandby(IIntroPart::Pointer part) const = 0;
/**
* Sets the standby state of the given intro part. Intro part usually should
* render themselves differently in the full and standby modes. In standby
* mode, the part should be partially visible to the user but otherwise
* allow them to work. In full mode, the part should be fully visible and
* be the center of the user's attention.
*
* This method does nothing if the part is null
or is not
- * the intro part returned by {@link #getIntro()}.
+ * the intro part returned by {@link #GetIntro}.
*
null
* @param standby true
to put the part in its partially
* visible standy mode, and false
to make it fully visible.
*/
virtual void SetIntroStandby(IIntroPart::Pointer part, bool standby) = 0;
/**
* Shows the intro part in the given workbench window. If the intro part has
* not been created yet, one will be created. If the intro part is currently
* being shown in some workbench window, that other window is made active.
*
* @param preferredWindow the preferred workbench window, or
* null
to indicate the currently active workbench window
* @param standby true
to put the intro part in its partially
* visible standy mode, and false
to make it fully visible
* @return the newly-created or existing intro part, or null
* if no intro part is available or if preferredWindow
is
* null
and there is no currently active workbench window
*/
virtual IIntroPart::Pointer ShowIntro(
IWorkbenchWindow::Pointer preferredWindow, bool standby) = 0;
/**
* Returns true
if there is an intro content detector and it
* reports that new intro content is available.
*
* @return true
if new intro content is available
*
* @since 3.3
*/
virtual bool IsNewContentAvailable() = 0;
};
}
#endif /* BERRYIINTROMANAGER_H_ */
diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
index 71099009de..512f075bdb 100644
--- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
+++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroPart.h
@@ -1,189 +1,189 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIINTROPART_H_
#define BERRYIINTROPART_H_
#include
* The intro part implementation is contributed to the workbench via the
* org.blueberry.ui.intro
extension point. There can be several
* intro part implementations, and associations between intro part
* implementations and products. The workbench will only make use of the intro
* part implementation for the current product (as given by
* {@link berry::Platform#GetProduct()}. There is at most one
* intro part instance in the entire workbench, and it resides in exactly one
* workbench window at a time.
*
* This interface in not intended to be directly implemented. Rather, clients * providing a intro part implementation should subclass * {@link berry::IntroPart}. *
* * @see IIntroManager#ShowIntro */ struct BERRY_UI_QT IIntroPart : public virtual Object { // IAdaptable { berryObjectMacro(berry::IIntroPart); ~IIntroPart() override; /** * Returns the site for this intro part. * * @return the intro site */ virtual IIntroSite::Pointer GetIntroSite() const = 0; /** * Initializes this intro part with the given intro site. A memento is * passed to the part which contains a snapshot of the part state from a * previous session. Where possible, the part should try to recreate that * state. ** This method is automatically called by the workbench shortly after * part construction. It marks the start of the intro's lifecycle. Clients * must not call this method. *
* * @param site the intro site * @param memento the intro part state ornull
if there is no previous
* saved state
* @exception PartInitException if this part was not initialized
* successfully
*/
virtual void Init(IIntroSite::Pointer site, IMemento::Pointer memento) = 0;
/**
* Sets the standby state of this intro part. An intro part should render
* itself differently in the full and standby modes. In standby mode, the
* part should be partially visible to the user but otherwise allow them
* to work. In full mode, the part should be fully visible and be the center
* of the user's attention.
* * This method is automatically called by the workbench at appropriate * times. Clients must not call this method directly (call - * {@link IIntroManager#setIntroStandby(IIntroPart, boolean)} instead. + * {@link IIntroManager#SetIntroStandby} instead. *
* * @param standbytrue
to put this part in its partially
* visible standy mode, and false
to make it fully visible
*/
virtual void StandbyStateChanged(bool standby) = 0;
/**
* Saves the object state within a memento.
* * This method is automatically called by the workbench at appropriate * times. Clients must not call this method directly. *
* * @param memento a memento to receive the object state */ virtual void SaveState(IMemento::Pointer memento) = 0; /** * Adds a listener for changes to properties of this intro part. * Has no effect if an identical listener is already registered. * * @param listener a property listener */ virtual void AddPropertyListener(IPropertyChangeListener* listener) = 0; /** * Creates the SWT controls for this intro part. ** Clients should not call this method (the workbench calls this method when * it needs to, which may be never). *
** For implementors this is a multi-step process: *
IActionService
.IActionService
.ISelectionService
* (optional). * The title image is usually used to populate the title bar of this part's * visual container. Since this image is managed by the part itself, callers * must not dispose the returned image. *
* * @return the title image */ virtual QIcon GetTitleImage() const = 0; /** * Returns the title of this intro part. ** The title is used to populate the title bar of this part's visual * container. *
* * @return the intro part title (notnull
)
*/
virtual QString GetPartName() const = 0;
/**
* Removes the given property listener from this intro part.
* Has no affect if an identical listener is not registered.
*
* @param listener a property listener
*/
virtual void RemovePropertyListener(IPropertyChangeListener* listener) = 0;
/**
* Asks this part to take focus within the workbench.
* * Clients should not call this method (the workbench calls this method at * appropriate times). To have the workbench activate a part, use - * {@link IIntroManager#showIntro(IWorkbenchWindow, boolean)}. + * {@link IIntroManager#ShowIntro}. *
*/ virtual void SetFocus() = 0; }; } Q_DECLARE_INTERFACE(berry::IIntroPart, "org.blueberry.ui.IIntroPart") #endif /* BERRYIINTROPART_H_ */ diff --git a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h index 4d3db03698..92fde8c48b 100644 --- a/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h +++ b/Plugins/org.blueberry.ui.qt/src/intro/berryIIntroSite.h @@ -1,68 +1,66 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef BERRYIINTROSITE_H_ #define BERRYIINTROSITE_H_ #include* The workbench exposes its implemention of intro part sites via this * interface, which is not intended to be implemented or extended by clients. *
- * - * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI_QT IIntroSite : public IWorkbenchSite { berryObjectMacro(berry::IIntroSite); ~IIntroSite() override; /** * Returns the part registry extension id for this intro site's part. *
* The name comes from the id
attribute in the configuration
* element.
*
* The interface that should be implemented by services that make themselves
* available through the IAdaptable
mechanism. This is the
* interface that drives the majority of services provided at the workbench
* level.
*
* A service has life-cycle. When the constructor completes, the service must be * fully functional. When it comes time for the service to go away, then the - * service will receive a {@link #dispose()} call. At this point, the service + * service will receive a {@link #Dispose} call. At this point, the service * must release all resources and detach all listeners. A service can only be * disposed once; it cannot be reused. *
** This interface has nothing to do with OSGi services. *
** This interface can be extended or implemented by clients. *
*/ struct IDisposable : public virtual Object { berryObjectMacro(berry::IDisposable); ~IDisposable() override; /** * Disposes of this service. All resources must be freed. All listeners must * be detached. Dispose will only be called once during the life cycle of a * service. */ virtual void Dispose() = 0; }; } #endif /* BERRYIDISPOSABLE_H_ */ diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h index 09608163c0..afcd3965b7 100644 --- a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h +++ b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationReference.h @@ -1,53 +1,53 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef BERRYIEVALUATIONREFERENCE_H #define BERRYIEVALUATIONREFERENCE_H #include "internal/berryIEvaluationResultCache.h" namespace berry { struct IPropertyChangeListener; /** * A token representing a core expression and property change listener currently * working in theIEvaluationService
.
*
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
+ * @note This interface is not intended to be implemented by clients.
+ * @note This interface is not intended to be extended by clients.
*/
struct IEvaluationReference : public virtual IEvaluationResultCache
{
berryObjectMacro(berry::IEvaluationReference);
/**
* The property change listener associated with the evaluated expression.
*
* @return the listener for updates.
*/
virtual IPropertyChangeListener* GetListener() const = 0;
/**
* The property used in change notifications.
*
* @return the property name.
*/
virtual QString GetProperty() const = 0;
};
}
#endif // BERRYIEVALUATIONREFERENCE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h
index 7f6c9d9f13..72334e47fe 100644
--- a/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h
+++ b/Plugins/org.blueberry.ui.qt/src/services/berryIEvaluationService.h
@@ -1,209 +1,207 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYIEVALUATIONSERVICE_H
#define BERRYIEVALUATIONSERVICE_H
#include IPropertyChangeListener
that will be notified as changes
* occur.
*
* This can be used to implement core expressions in client extension points
* similar to the <enabledWhen> of
* org.blueberry.ui.handlers/handler
elements.
*
* The service will fire TRUE
and
* FALSE
for the oldValue and newValue in the property
* change events.
*
* Adding the evaluation listener will fire one change with oldValue=null
* and newValue="evaluated expression". Remove the
* IEvaluationReference
will fire one change with
* oldValue="last evaluated value" and newValue=null
.
*
* Adding a service listener will fire the {@link #PROP_NOTIFYING} property
* change event with newValue=TRUE
when a source change
* causes expression evaluations to update and another {@link #PROP_NOTIFYING}
* property change event with newValue=FALSE
when the
* changes that started with a specific source change have finished. The
* {@link #PROP_NOTIFYING} change events will not be fired for source changes
* caused by the outer most recalculations.
*
* Variable sources can be provided to this service using the org.blueberry.ui.services
* Extension Point. This makes the available to <with/> expressions.
*
* This service can be acquired from your service locator: *
* IEvaluationService::Pointer service = GetSite()->GetService(IEvaluationService::GetManifestName()); **
TRUE
.
* This property is not fired for any source changes caused by the outer
* recalculations.
* * Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param listener * The listener to be notified. Must not benull
.
* Has no effect if the listener has already been added.
*/
virtual void AddServiceListener(IPropertyChangeListener* listener) = 0;
/**
* Remove the listener for {@link #PROP_NOTIFYING} property changes.
*
* @param listener
* The listener to remove. Must not be null
. Has
* no effect if the listener is not currently registered.
*/
virtual void RemoveServiceListener(IPropertyChangeListener* listener) = 0;
/**
* Add a listener that can be notified when the workbench application
* context causes the expression evaluation value to change.
* * Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param expression * the core expression to evaluate. * @param listener * the listener to be notified. * @param property * the property contained in the notification * @return a token that can be used to remove this listener. - * {@link #removeEvaluationListener(IEvaluationReference)} + * {@link #RemoveEvaluationListener} */ virtual SmartPointer* It will only accept IEvaluationReferences returned from a previous call - * to - * {@link #addEvaluationListener(Expression, IPropertyChangeListener, String)} - * on this service. + * to {@link #AddEvaluationListener} on this service. *
** Note: references should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *
* * @param ref * The listener to re-add. - * @see #removeEvaluationListener(IEvaluationReference) + * @see #RemoveEvaluationListener */ virtual void AddEvaluationReference(const SmartPointer* Note: This context should not be modified. *
* * @return the latest context. * @see ISources#ACTIVE_CURRENT_SELECTION_NAME */ virtual SmartPointer* Notes: *
org.eclipse.core.resources.name
. Must not be
* null
.
*/
virtual void RequestEvaluation(const QString& propertyName) = 0;
};
}
Q_DECLARE_INTERFACE(berry::IEvaluationService, "org.blueberry.ui.IEvaluationService")
#endif // BERRYIEVALUATIONSERVICE_H
diff --git a/Plugins/org.blueberry.ui.qt/src/tweaklets/berryGuiWidgetsTweaklet.h b/Plugins/org.blueberry.ui.qt/src/tweaklets/berryGuiWidgetsTweaklet.h
index a5a8a7288c..ce09eb7a02 100755
--- a/Plugins/org.blueberry.ui.qt/src/tweaklets/berryGuiWidgetsTweaklet.h
+++ b/Plugins/org.blueberry.ui.qt/src/tweaklets/berryGuiWidgetsTweaklet.h
@@ -1,206 +1,208 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef BERRYGUIWIDGETSTWEAKLET_H_
#define BERRYGUIWIDGETSTWEAKLET_H_
#include "internal/berryTweaklets.h"
#include "guitk/berryGuiTkISelectionListener.h"
#include "guitk/berryGuiTkIControlListener.h"
#include "berryShell.h"
//#include "commands/berryIMenu.h"
//#include "commands/berryIMenuItem.h"
namespace berry {
struct BERRY_UI_QT GuiWidgetsTweaklet
{
static Tweaklets::TweakKeyIControlListener
* interface.
*
+ * @param widget
* @param listener the listener which should be notified
*
* @see IControlListener
* @see #RemoveControlListener
*/
virtual void AddControlListener(QWidget* widget, GuiTk::IControlListener::Pointer listener) = 0;
/**
* Removes the listener from the collection of listeners who will
* be notified when the widget is moved or resized.
*
+ * @param widget
* @param listener the listener which should no longer be notified
*
* @see IControlListener
* @see #AddControlListener
*/
virtual void RemoveControlListener(QWidget* widget, GuiTk::IControlListener::Pointer listener) = 0;
virtual bool GetEnabled(QWidget* widget) = 0;
virtual void SetEnabled(QWidget* widget, bool enabled) = 0;
virtual void SetBounds(QWidget* widget, const QRect& bounds) = 0;
virtual QRect GetBounds(QWidget* widget) = 0;
virtual void SetVisible(QWidget* widget, bool visible) = 0;
virtual bool GetVisible(QWidget* widget) = 0;
virtual bool IsVisible(QWidget* widget) = 0;
virtual QRect GetClientArea(QWidget* widget) = 0;
virtual QWidget* GetParent(QWidget* widget) = 0;
virtual bool SetParent(QWidget* widget, QWidget* parent) = 0;
virtual void SetData(QWidget* widget, const QString& id, Object::Pointer data) = 0;
virtual Object::Pointer GetData(QWidget* widget, const QString& id) = 0;
virtual QPoint GetCursorLocation() = 0;
virtual QWidget* GetCursorControl() = 0;
virtual QWidget* FindControl(const QList