author | dadubrow |
Tue, 27 Jul 2010 15:29:41 -0500 | |
changeset 1705 | 71a151b1b515 |
parent 1684 | core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalExtension.java@c2eba6dabd38 |
child 1721 | 18638adda547 |
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.swt.widgets.Composite; |
|
21 |
import org.eclipse.swt.widgets.Control; |
|
22 |
import org.eclipse.ui.IEditorPart; |
|
23 |
||
24 |
/** |
|
1705 | 25 |
* Interface to a portal page layer extension |
1609 | 26 |
*/ |
1705 | 27 |
public interface IPortalPageLayer { |
1609 | 28 |
|
29 |
/** |
|
1705 | 30 |
* The title of this portal page layer |
31 |
* @return String |
|
32 |
*/ |
|
33 |
String getTitle(); |
|
34 |
||
35 |
/** |
|
36 |
* Interface to an action/navigation bar for the portal portal page layer |
|
1609 | 37 |
*/ |
38 |
public interface IActionBar { |
|
39 |
||
40 |
/** |
|
1615 | 41 |
* Required title for the action bar |
1609 | 42 |
* @return String |
43 |
*/ |
|
44 |
String getTitle(); |
|
45 |
||
46 |
/** |
|
47 |
* Actions shown in the action bar: |
|
48 |
* Required: text and run() methods |
|
49 |
* Optional: tool tip text |
|
1684
c2eba6dabd38
refactor to allow better support for multiple layers
dadubrow
parents:
1661
diff
changeset
|
50 |
* Unused: image/check |
1609 | 51 |
* @return IAction |
52 |
*/ |
|
53 |
IAction[] getActions(); |
|
1661 | 54 |
|
55 |
/** |
|
56 |
* Action ids for actions that should be emphasized in the action bar (e.g., bold font) |
|
57 |
* @return String[] or null |
|
58 |
*/ |
|
59 |
String[] getHighlightedActionIds(); |
|
1609 | 60 |
|
61 |
} |
|
62 |
||
63 |
/** |
|
64 |
* Interface allowing the UI for provided actions of an IActionBar to be updated (e.g., enabled state) |
|
65 |
*/ |
|
66 |
public interface IActionUIUpdater { |
|
67 |
||
68 |
/** |
|
69 |
* Update the UI for a specific action by id |
|
70 |
* @param actionId |
|
71 |
*/ |
|
72 |
void update(String actionId); |
|
73 |
||
74 |
/** |
|
75 |
* Update the UI for all actions in the IActionBar |
|
76 |
*/ |
|
77 |
void updateAll(); |
|
78 |
||
79 |
} |
|
80 |
||
81 |
/** |
|
1705 | 82 |
* Called to create the control for the portal page layer |
1609 | 83 |
* @param parent Composite |
84 |
* @param part IEditorPart |
|
85 |
* @return Control |
|
86 |
*/ |
|
87 |
Control createControl(Composite parent, IEditorPart part); |
|
88 |
||
89 |
/** |
|
1705 | 90 |
* Called to initialize the portal page layer when shown for the first time |
1609 | 91 |
*/ |
92 |
void init(); |
|
93 |
||
94 |
/** |
|
1705 | 95 |
* Return action bars for the portal page layer |
1609 | 96 |
* @param part IEditorPart |
97 |
* @param updater IActionUIUpdater |
|
98 |
* @return IActionBar[] |
|
99 |
*/ |
|
100 |
IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater); |
|
101 |
||
102 |
/** |
|
1705 | 103 |
* Called to dispose internal resources of the portal page layer |
1609 | 104 |
*/ |
105 |
void dispose(); |
|
106 |
} |