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