KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > compare > ICompareContainer


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.compare;
12
13 import org.eclipse.compare.structuremergeviewer.ICompareInput;
14 import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
15 import org.eclipse.jface.action.MenuManager;
16 import org.eclipse.jface.operation.IRunnableContext;
17 import org.eclipse.jface.operation.IRunnableWithProgress;
18 import org.eclipse.jface.viewers.ISelectionProvider;
19 import org.eclipse.ui.*;
20 import org.eclipse.ui.services.IServiceLocator;
21
22 /**
23  * A compare container is used to represent any UI that can contain compare viewers.
24  * <p>
25  * This interface is not intended to be implemented by clients.
26  * </p>
27  * @since 3.3
28  */

29 public interface ICompareContainer extends IRunnableContext{
30     
31     /**
32      * Register for change events for the given compare input. Although clients can register
33      * with the compare input directly, registering through the container allows for
34      * deterministic and optimized behavior in some cases. Registering multiple times for the
35      * same compare input has no effect.
36      * @param input the compare input
37      * @param listener the compare input change listener
38      */

39     public void addCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener);
40     
41     /**
42      * Remove the change listener from the given compare input. Removing a listener that is not
43      * registered has no effect.
44      * @param input the compare input
45      * @param listener the compare input change listener
46      */

47     public void removeCompareInputChangeListener(ICompareInput input, ICompareInputChangeListener listener);
48
49     /**
50      * Register the content menu with the container to give the container a chance to
51      * add additional items to the context menu such as popup menu object contributions.
52      * The provided menu should have a {@link IWorkbenchActionConstants#MB_ADDITIONS}
53      * separator as this is where the container will add actions.
54      * @param menu the menu being registered
55      * @param selectionProvider the selection provider
56      */

57     public void registerContextMenu(MenuManager menu, ISelectionProvider selectionProvider);
58     
59     /**
60      * Set the status message displayed by the container to the given message
61      * @param message the status message
62      */

63     public void setStatusMessage(String JavaDoc message);
64     
65     /**
66      * Return the action bars for the container or <code>null</code> if the container
67      * does not have an action bars.
68      * @return the action bars for the container or <code>null</code>
69      */

70     public IActionBars getActionBars();
71     
72     /**
73      * Return the service locator for the container or <code>null</code> if the container
74      * does not have one.
75      * @return the service locator for the container or <code>null</code>
76      */

77     public IServiceLocator getServiceLocator();
78
79     /**
80      * Return the {@link ICompareNavigator} associated with this container or <code>null</code>
81      * if the container does not have a global navigator.
82      * @return the {@link ICompareNavigator} associated with this container or <code>null</code>
83      */

84     public ICompareNavigator getNavigator();
85     
86     /**
87      * Queue the given task to be run asynchronously. If the given runnable was
88      * previously queued to run asynchronously and it has not yet run, the task
89      * position will be moved to the end of the queue. If the task that is being
90      * queued is currently running, the running task will be canceled and added
91      * to the end of the queue.
92      * <p>
93      * This method should be treated as a request to run the given task asynchronously.
94      * However, clients should not assume that the code will be run asynchronously.
95      * Depending on the container implementation, a call to this method may or may
96      * not block the caller until the task is completed. Also, the task may be executed
97      * in a modal or non-modal fashion.
98      *
99      * @param runnable the task to be performed
100      */

101     public void runAsynchronously(IRunnableWithProgress runnable);
102
103     /**
104      * Return the workbench part associated with this container or
105      * <code>null</code> if there is no part or it is not available.
106      * @return the workbench part associated with this container or
107      * <code>null</code>
108      */

109     public IWorkbenchPart getWorkbenchPart();
110     
111 }
112
Popular Tags