core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPage.java
branchC3_BUILDER_WORK
changeset 1724 b99f029f4d47
parent 1720 6433764204b0
parent 1723 b386036cfe5d
child 1730 e0e324a4ef67
equal deleted inserted replaced
1720:6433764204b0 1724:b99f029f4d47
     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 /**
       
    26  * Interface to a portal page extension
       
    27  */
       
    28 public interface IPortalPage {
       
    29 
       
    30 	/**
       
    31 	 * Interface to an action/navigation bar for the portal page
       
    32 	 */
       
    33 	public interface IActionBar {
       
    34 		
       
    35 		/**
       
    36 		 * Required title for the action bar
       
    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
       
    45 		 * Unused: image
       
    46 		 * @return IAction
       
    47 		 */
       
    48 		IAction[] getActions();
       
    49 
       
    50 	}
       
    51 	
       
    52 	/**
       
    53 	 * Interface allowing the UI for provided actions of an IActionBar to be updated (e.g., enabled state)
       
    54 	 */
       
    55 	public interface IActionUIUpdater {
       
    56 		
       
    57 		/**
       
    58 		 * Update the UI for a specific action by id
       
    59 		 * @param actionId
       
    60 		 */
       
    61 		void update(String actionId);
       
    62 		
       
    63 		/**
       
    64 		 * Update the UI for all actions in the IActionBar
       
    65 		 */
       
    66 		void updateAll();
       
    67 		
       
    68 	}
       
    69 
       
    70 	/**
       
    71 	 * Required title text used by main navigation bar
       
    72 	 * @return String
       
    73 	 */
       
    74 	String getText();
       
    75 	
       
    76 	/**
       
    77 	 * Required image descriptor used by main navigation bar
       
    78 	 * @return ImageDescriptor
       
    79 	 */
       
    80 	ImageDescriptor getImageDescriptor();
       
    81 	
       
    82 	/**
       
    83 	 * Called to create the control for the page
       
    84 	 * @param parent Composite
       
    85 	 * @param part IEditorPart
       
    86 	 * @return Control
       
    87 	 */
       
    88 	Control createControl(Composite parent, IEditorPart part);
       
    89 	
       
    90 	/**
       
    91 	 * Called to initialize the page when shown for the first time
       
    92 	 */
       
    93 	void init();
       
    94 	
       
    95 	/**
       
    96 	 * Return action bars for the page (can't be null)
       
    97 	 * @param part IEditorPart
       
    98 	 * @param updater IActionUIUpdater
       
    99 	 * @return IActionBar[]
       
   100 	 */
       
   101 	IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater);
       
   102 	
       
   103 	/**
       
   104 	 * Called to dispose internal resources of the page
       
   105 	 */
       
   106 	void dispose();
       
   107 }