author | dadubrow |
Mon, 26 Jul 2010 15:11:10 -0500 | |
changeset 1684 | c2eba6dabd38 |
parent 1661 | core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPage.java@cd8159f371c7 |
permissions | -rw-r--r-- |
1609 | 1 |
/* |
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
package com.nokia.carbide.internal.discovery.ui.extension; |
|
18 |
||
19 |
import org.eclipse.jface.action.IAction; |
|
20 |
import org.eclipse.jface.resource.ImageDescriptor; |
|
21 |
import org.eclipse.swt.widgets.Composite; |
|
22 |
import org.eclipse.swt.widgets.Control; |
|
23 |
import org.eclipse.ui.IEditorPart; |
|
24 |
||
25 |
/** |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
26 |
* Interface to a portal extension |
1609 | 27 |
*/ |
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
28 |
public interface IPortalExtension { |
1609 | 29 |
|
30 |
/** |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
31 |
* Interface to an action/navigation bar for the portal extension |
1609 | 32 |
*/ |
33 |
public interface IActionBar { |
|
34 |
||
35 |
/** |
|
1615 | 36 |
* Required title for the action bar |
1609 | 37 |
* @return String |
38 |
*/ |
|
39 |
String getTitle(); |
|
40 |
||
41 |
/** |
|
42 |
* Actions shown in the action bar: |
|
43 |
* Required: text and run() methods |
|
44 |
* Optional: tool tip text |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
45 |
* Unused: image/check |
1609 | 46 |
* @return IAction |
47 |
*/ |
|
48 |
IAction[] getActions(); |
|
1661 | 49 |
|
50 |
/** |
|
51 |
* Action ids for actions that should be emphasized in the action bar (e.g., bold font) |
|
52 |
* @return String[] or null |
|
53 |
*/ |
|
54 |
String[] getHighlightedActionIds(); |
|
1609 | 55 |
|
56 |
} |
|
57 |
||
58 |
/** |
|
59 |
* Interface allowing the UI for provided actions of an IActionBar to be updated (e.g., enabled state) |
|
60 |
*/ |
|
61 |
public interface IActionUIUpdater { |
|
62 |
||
63 |
/** |
|
64 |
* Update the UI for a specific action by id |
|
65 |
* @param actionId |
|
66 |
*/ |
|
67 |
void update(String actionId); |
|
68 |
||
69 |
/** |
|
70 |
* Update the UI for all actions in the IActionBar |
|
71 |
*/ |
|
72 |
void updateAll(); |
|
73 |
||
74 |
} |
|
75 |
||
76 |
/** |
|
77 |
* Required title text used by main navigation bar |
|
78 |
* @return String |
|
79 |
*/ |
|
80 |
String getText(); |
|
81 |
||
82 |
/** |
|
83 |
* Required image descriptor used by main navigation bar |
|
84 |
* @return ImageDescriptor |
|
85 |
*/ |
|
86 |
ImageDescriptor getImageDescriptor(); |
|
87 |
||
88 |
/** |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
89 |
* Called to create the control for the extension |
1609 | 90 |
* @param parent Composite |
91 |
* @param part IEditorPart |
|
92 |
* @return Control |
|
93 |
*/ |
|
94 |
Control createControl(Composite parent, IEditorPart part); |
|
95 |
||
96 |
/** |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
97 |
* Called to initialize the extension when shown for the first time |
1609 | 98 |
*/ |
99 |
void init(); |
|
100 |
||
101 |
/** |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
102 |
* Return action bars for the extension |
1609 | 103 |
* @param part IEditorPart |
104 |
* @param updater IActionUIUpdater |
|
105 |
* @return IActionBar[] |
|
106 |
*/ |
|
107 |
IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater); |
|
108 |
||
109 |
/** |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
110 |
* Called to dispose internal resources of the extension |
1609 | 111 |
*/ |
112 |
void dispose(); |
|
113 |
} |