/* * (non-Javadoc) * * @see org.marketcetera.photon.views.MessagesViewBase#initializeToolBar(org.eclipse.jface.action.IToolBarManager) */ @Override protected void initializeToolBar(IToolBarManager inTheToolBarManager) { inTheToolBarManager.add( new ControlContribution(null) { @Override protected Control createControl(Composite parent) { // surround in composite to be able to control the layout Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.swtDefaults().applyTo(composite); Label label = new Label(composite, SWT.NONE); label.setText(Messages.FIX_MESSAGE_VIEW_FILTER_LABEL.getText()); GridDataFactory.defaultsFor(label).applyTo(label); return composite; } }); TextContributionItem filterTextContributionItem = new TextContributionItem(""); // $NON-NLS-1$ filterTextContributionItem.addKeyListener( new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { Text theText = (Text) e.widget; setFilterText(theText.getText()); if ('\r' == e.character) { try { handleFilter(mFilterText); } catch (Throwable t) { t.printStackTrace(); } } } }); inTheToolBarManager.add(filterTextContributionItem); // Add execution report button inTheToolBarManager.add(new AddExecutionReportAction()); }
@Override public void setFocus() { if (mSymbolEntryText.isEnabled()) mSymbolEntryText.setFocus(); }