core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java
changeset 1615 d5f384bf1e88
parent 1609 085da1889c59
child 1618 712d047abd8b
equal deleted inserted replaced
1614:b1456c010578 1615:d5f384bf1e88
    33 
    33 
    34 import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage.IActionBar;
    34 import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage.IActionBar;
    35 
    35 
    36 class TaskBar extends RoundedCornerComposite {
    36 class TaskBar extends RoundedCornerComposite {
    37 
    37 
       
    38 	private static final String FONT_NAME = "Arial"; //$NON-NLS-1$
       
    39 
    38 	private final class ActionListener implements IHyperlinkListener {
    40 	private final class ActionListener implements IHyperlinkListener {
    39 		@Override
    41 		@Override
    40 		public void linkActivated(HyperlinkEvent e) {
    42 		public void linkActivated(HyperlinkEvent e) {
    41 			Hyperlink link = (Hyperlink) e.getSource();
    43 			Hyperlink link = (Hyperlink) e.getSource();
    42 			runAction(link);
    44 			runAction(link);
    64 				parent.getDisplay().getSystemColor(SWT.COLOR_BLACK),
    66 				parent.getDisplay().getSystemColor(SWT.COLOR_BLACK),
    65 				parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    67 				parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    66 		this.portalEditor = portalEditor;
    68 		this.portalEditor = portalEditor;
    67 		createTitle(actionBar);
    69 		createTitle(actionBar);
    68 		createActions(actionBar);
    70 		createActions(actionBar);
    69 		setLayoutData(GridDataFactory.swtDefaults().grab(true, true).align(SWT.CENTER, SWT.BEGINNING).create());
    71 		GridDataFactory.swtDefaults().grab(true, true).align(SWT.CENTER, SWT.BEGINNING).applyTo(this);
    70 		setLayout(RowLayoutFactory.swtDefaults().type(SWT.VERTICAL).margins(10, 10).extendedMargins(5, 5, 5, 10).fill(true).wrap(false).create());
    72 		RowLayoutFactory.swtDefaults().type(SWT.VERTICAL).margins(10, 10).extendedMargins(5, 5, 5, 10).fill(true).wrap(false).applyTo(this);
    71 	}
    73 	}
    72 
    74 
    73 	private void createTitle(IActionBar actionBar) {
    75 	private void createTitle(IActionBar actionBar) {
    74 		String title = actionBar.getTitle();
    76 		Label l = new Label(this, SWT.LEFT);
    75 		if (title != null) {
    77 		l.setFont(portalEditor.createFont(FONT_NAME, 10, SWT.BOLD));
    76 			Label l = new Label(this, SWT.LEFT);
    78 		l.setBackground(l.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    77 			l.setFont(portalEditor.createFont("Arial", 10, SWT.BOLD));
    79 		l.setText(actionBar.getTitle());
    78 			l.setBackground(l.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    80 		RowDataFactory.swtDefaults().applyTo(l);
    79 			l.setText(title);
    81 		l = new Label(this, SWT.HORIZONTAL | SWT.SEPARATOR);
    80 			l.setLayoutData(RowDataFactory.swtDefaults().create());
    82 		RowDataFactory.swtDefaults().applyTo(l);
    81 			l = new Label(this, SWT.HORIZONTAL | SWT.SEPARATOR);
       
    82 			l.setLayoutData(RowDataFactory.swtDefaults().create());
       
    83 		}
       
    84 	}
    83 	}
    85 
    84 
    86 	private void createActions(IActionBar actionBar) {
    85 	private void createActions(IActionBar actionBar) {
    87 		listener = new ActionListener();
    86 		listener = new ActionListener();
    88 		linkToActionMap = new HashMap<Hyperlink, IAction>();
    87 		linkToActionMap = new HashMap<Hyperlink, IAction>();