core/com.nokia.carbide.cpp.news.reader/src/com/nokia/carbide/cpp/internal/news/reader/ui/NewsControlContribution.java
changeset 703 3a27d56389d5
parent 0 fb279309251b
child 723 81b14a47b8dc
equal deleted inserted replaced
698:9162f4cfad65 703:3a27d56389d5
    43 
    43 
    44 	// private data
    44 	// private data
    45 	private static NewsControlContribution sharedInstance;
    45 	private static NewsControlContribution sharedInstance;
    46 	private Label label;
    46 	private Label label;
    47 	private boolean alert;
    47 	private boolean alert;
       
    48 	private Composite container;
    48 
    49 
    49 	/**
    50 	/**
    50 	 * The constructor.
    51 	 * The constructor.
    51 	 */
    52 	 */
    52 	public NewsControlContribution() {
    53 	public NewsControlContribution() {
    59 	 * (non-Javadoc)
    60 	 * (non-Javadoc)
    60 	 * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
    61 	 * @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
    61 	 */
    62 	 */
    62 	@Override
    63 	@Override
    63 	protected Control createControl(Composite parent) {
    64 	protected Control createControl(Composite parent) {
    64 		Composite container = new Composite(parent, SWT.NONE);
    65 		container = new Composite(parent, SWT.NONE);
    65 		GridLayoutFactory.fillDefaults().margins(2, 2).applyTo(container);
    66 		GridLayoutFactory.fillDefaults().margins(2, 2).applyTo(container);
    66 
    67 
    67 		// Create a label for the trim.
    68 		// Create a label for the trim.
    68 		label = new Label(container, SWT.CENTER);
    69 		label = new Label(container, SWT.BOTTOM);
    69 		GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(label);
    70 		GridDataFactory.swtDefaults().grab(false, true).applyTo(label);
    70 		String text = CarbideNewsReaderPlugin.getFeedManager().getUnreadEntriesCount() + " unread";
    71 		String text = CarbideNewsReaderPlugin.getFeedManager().getUnreadEntriesCount() + " unread";
    71 		label.setText(text);
    72 		label.setText(text);
    72 		if (alert) {
    73 		if (alert) {
    73 			Font font = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
    74 			Font font = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
    74 			label.setFont(font);
    75 			label.setFont(font);
    75 			alert = false;
    76 			alert = false;
    76 		}
    77 		}
    77 
    78 		
    78 		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, NewsUIHelpIDs.NEWSREADER_TRIM_COMMAND);
    79 		PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, NewsUIHelpIDs.NEWSREADER_TRIM_COMMAND);
    79 		return container;
    80 		return container;
    80 	}
    81 	}
    81 
    82 
    82 	/*
    83 	/*