All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ui.commands.ICommandManager Maven / Gradle / Ivy

Go to download

This plug-in contains the bulk of the Workbench implementation, and depends on JFace, SWT, and Core Runtime. It cannot be used independently from org.eclipse.ui. Workbench client plug-ins should not depend directly on this plug-in.

The newest version!
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.ui.commands;

import java.util.Map;
import java.util.Set;

import org.eclipse.ui.keys.KeySequence;

/**
 * 

* An instance of ICommandManager can be used to obtain instances * of ICommand, as well as manage whether or not those instances * are active or inactive, enabled or disabled. *

*

* This interface is not intended to be extended or implemented by clients. *

* * @since 3.0 * @see org.eclipse.ui.commands.ICommand * @see org.eclipse.ui.commands.ICommandManagerListener * @see org.eclipse.core.commands.CommandManager * @deprecated Please use the "org.eclipse.core.commands" plug-in instead. */ public interface ICommandManager { /** * Registers an instance of ICommandManagerListener to listen * for changes to attributes of this instance. * * @param commandManagerListener * the instance of ICommandManagerListener to * register. Must not be null. If an attempt is * made to register an instance of * ICommandManagerListener which is already * registered with this instance, no operation is performed. */ void addCommandManagerListener( ICommandManagerListener commandManagerListener); /** * Returns the set of identifiers to active contexts. *

* Notification is sent to all registered listeners if this property * changes. *

* * @return the set of identifiers to active contexts. This set may be * empty, but is guaranteed not to be null. If this * set is not empty, it is guaranteed to only contain instances of * String. */ Set getActiveContextIds(); /** * Returns the active key configuration. *

* Notification is sent to all registered listeners if this property * changes. *

* * @return the active key configuration identifier. This set may be empty, * but it is guaranteed to not be null. If this set * is not empty, it is guaranteed to only contains instances of * String. */ String getActiveKeyConfigurationId(); /** * Returns the active locale. While this property tends to be simply the * result of {@link java.util.Locale#getDefault()}, it may also be changed * at runtime by different implementations of command manager. *

* Notification is sent to all registered listeners if this property * changes. *

* * @return the active locale. May be null. */ String getActiveLocale(); /** * Returns the active platform. While this property tends to be simply the * result of {@link org.eclipse.swt.SWT#getPlatform()}, it may also be * changed at runtime by different implementations of command manager. *

* Notification is sent to all registered listeners if this property * changes. *

* * @return the active platform. May be null. */ String getActivePlatform(); /** * Returns a handle to a category given an identifier. * * @param categoryId * an identifier. Must not be null * @return a handle to a category. */ ICategory getCategory(String categoryId); /** * Returns a handle to a command given an identifier. * * @param commandId * an identifier. Must not be null * @return a handle to a command; never null. */ ICommand getCommand(String commandId); /** *

* Returns the set of identifiers to defined categories. *

*

* Notification is sent to all registered listeners if this attribute * changes. *

* * @return the set of identifiers to defined categories. This set may be * empty, but is guaranteed not to be null. If this * set is not empty, it is guaranteed to only contain instances of * String. */ Set getDefinedCategoryIds(); /** *

* Returns the set of identifiers to defined commands. *

*

* Notification is sent to all registered listeners if this attribute * changes. *

* * @return the set of identifiers to defined commands. This set may be * empty, but is guaranteed not to be null. If this * set is not empty, it is guaranteed to only contain instances of * String. */ Set getDefinedCommandIds(); /** *

* Returns the set of identifiers to defined key configurations. *

*

* Notification is sent to all registered listeners if this attribute * changes. *

* * @return the set of identifiers to defined key configurations. This set * may be empty, but is guaranteed not to be null. * If this set is not empty, it is guaranteed to only contain * instances of String. */ Set getDefinedKeyConfigurationIds(); /** * Returns a handle to a key configuration given an identifier. * * @param keyConfigurationId * an identifier. Must not be null * @return a handle to a key configuration. */ IKeyConfiguration getKeyConfiguration(String keyConfigurationId); /** * Finds all of the commands which have key bindings that start with the * given key sequence. * * @param keySequence * The prefix to look for; must not be null. * @return A map of all of the matching key sequences ( * KeySequence) to command identifiers ( * String). This map may be empty, but it is never * null. */ Map getPartialMatches(KeySequence keySequence); /** * Finds the command which has the given key sequence as one of its key * bindings. * * @param keySequence * The key binding to look for; must not be null. * @return The command id for the matching command, if any; * null if none. */ String getPerfectMatch(KeySequence keySequence); /** * Checks to see whether there are any commands which have key bindings that * start with the given key sequence. * * @param keySequence * The prefix to look for; must not be null. * @return true if at least one command has a key binding * that starts with keySequence;false * otherwise. */ boolean isPartialMatch(KeySequence keySequence); /** * Checks to see if there is a command with the given key sequence as one of * its key bindings. * * @param keySequence * The key binding to look for; must not be null. * @return true if a command has a matching key binding; * false otherwise. */ boolean isPerfectMatch(KeySequence keySequence); /** * Unregisters an instance of ICommandManagerListener * listening for changes to attributes of this instance. * * @param commandManagerListener * the instance of ICommandManagerListener to * unregister. Must not be null. If an attempt is * made to unregister an instance of * ICommandManagerListener which is not already * registered with this instance, no operation is performed. */ void removeCommandManagerListener( ICommandManagerListener commandManagerListener); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy