List of usage examples for org.eclipse.jface.resource JFaceResources getBannerFont
public static Font getBannerFont()
From source file:au.gov.ga.earthsci.bookmark.part.editor.CameraPropertyEditor.java
License:Apache License
private PositionEditor addPositionEditor(final Position pos, final String fieldId, final String labelText, final String invalidMessage) { Label label = new Label(container, SWT.NONE); label.setText(labelText);/*from w w w . j a va 2s . c om*/ label.setFont(JFaceResources.getBannerFont()); PositionEditor editor = new PositionEditor(container, SWT.NONE); if (pos != null) { editor.setPositionValue(pos); } GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; editor.setLayoutData(gd); editor.addPositionEditorListener(new PositionEditorListener() { @Override public void positionChanged(PositionChangedEvent e) { validate(fieldId, e.isValid(), new BookmarkEditorMessage(Level.ERROR, INVALID_POSITION_ERROR, invalidMessage)); } }); return editor; }
From source file:au.gov.ga.earthsci.bookmark.part.editor.CameraPropertyEditor.java
License:Apache License
private Vec4Editor addVec4Editor(final Vec4 vec, final String fieldId, final String labelText, final String invalidMessage) { Label label = new Label(container, SWT.NONE); label.setText(labelText);/*from ww w . j a v a 2s .c o m*/ label.setFont(JFaceResources.getBannerFont()); Vec4Editor editor = new Vec4Editor(container, SWT.NONE); if (vec != null) { editor.setVec4Value(vec); } GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; editor.setLayoutData(gd); editor.addVec4EditorListener(new Vec4EditorListener() { @Override public void vec4Changed(Vec4ChangedEvent e) { validate(fieldId, e.isValid(), new BookmarkEditorMessage(Level.ERROR, INVALID_VEC4_ERROR, invalidMessage)); } }); return editor; }
From source file:au.gov.ga.earthsci.bookmark.ui.editor.ExaggerationPropertyEditor.java
License:Apache License
private DoubleEditor addDoubleEditor(final Double value, final String fieldId, final String labelText, final String invalidMessage) { Label label = new Label(container, SWT.NONE); label.setText(labelText);//from www .j a v a 2 s .co m label.setFont(JFaceResources.getBannerFont()); DoubleEditor editor = new DoubleEditor(container, SWT.NONE); if (value != null) { editor.setDoubleValue(value); } GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; editor.setLayoutData(gd); editor.addDoubleEditorListener(new DoubleEditorListener() { @Override public void doubleChanged(DoubleChangedEvent e) { validate(fieldId, e.isValid(), new BookmarkEditorMessage(Level.ERROR, INVALID_EXAGGERATION_ERROR, invalidMessage)); } }); return editor; }
From source file:au.gov.ga.earthsci.eclipse.extras.browser.BrowserText.java
License:Open Source License
private void fillContent(Composite parent, Color bg) { GridLayout layout = new GridLayout(); layout.verticalSpacing = 10;/*from w w w .ja va 2 s .c om*/ parent.setLayout(layout); title = new Label(parent, SWT.WRAP); title.setText(Messages.BrowserText_title); title.setFont(JFaceResources.getHeaderFont()); title.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); title.setBackground(bg); link = new Link(parent, SWT.WRAP); link.setText(Messages.BrowserText_link); link.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); link.setToolTipText(Messages.BrowserText_tooltip); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { BusyIndicator.showWhile(link.getDisplay(), new Runnable() { public void run() { doOpenExternal(); } }); } }); link.setBackground(bg); sep = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); sep.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); exTitle = new Label(parent, SWT.NULL); exTitle.setBackground(bg); exTitle.setFont(JFaceResources.getBannerFont()); exTitle.setText(Messages.BrowserText_dtitle); exTitle.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text = new Label(parent, SWT.WRAP); text.setText(Messages.BrowserText_text); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text.setBackground(bg); button = new Button(parent, SWT.PUSH); updateButtonText(); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { toggleException(); } }); exception = new Text(parent, SWT.MULTI); loadExceptionText(); GridData gd = new GridData(GridData.FILL_BOTH); gd.exclude = true; exception.setLayoutData(gd); }
From source file:cc.warlock.rcp.application.WarlockUpdateDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite main = (Composite) super.createDialogArea(parent); Label heading = new Label(main, SWT.NONE); heading.setFont(JFaceResources.getBannerFont()); heading.setText("Warlock Automatic Updates"); Label description = new Label(main, SWT.WRAP); description.setText(/*from w w w . j a v a2 s. c o m*/ "Warlock has found new updates to download.\n\nSelect the updates below that you would like to install, or press Cancel to ignore this update."); description.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); updateTable = new TableViewer(main, SWT.CHECK | SWT.BORDER); TableColumn check = new TableColumn(updateTable.getTable(), SWT.NONE, 0); check.setText(" "); check.setWidth(20); TableColumn name = new TableColumn(updateTable.getTable(), SWT.NONE, 1); name.setText("Warlock Feature"); name.setWidth(150); TableColumn currentVersion = new TableColumn(updateTable.getTable(), SWT.NONE, 2); currentVersion.setText("Current Version"); currentVersion.setWidth(100); TableColumn newVersion = new TableColumn(updateTable.getTable(), SWT.NONE, 3); newVersion.setText("New Version"); newVersion.setWidth(100); updateTable.getTable().setHeaderVisible(true); updateTable.setContentProvider(ArrayContentProvider.getInstance()); updateTable.setLabelProvider(new ITableLabelProvider() { @Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 1) return WarlockSharedImages.getImage(WarlockSharedImages.IMG_FEATURE); return null; } @Override public String getColumnText(Object element, int columnIndex) { Update update = (Update) element; if (columnIndex == 1) { //name return update.replacement.getProperty(IInstallableUnit.PROP_NAME); } else if (columnIndex == 2) { //old version return update.toUpdate.getVersion().toString(); } else if (columnIndex == 3) { //new version update.replacement.getVersion().toString(); } return ""; } @Override public void addListener(ILabelProviderListener listener) { } @Override public void dispose() { } @Override public boolean isLabelProperty(Object element, String property) { return true; } @Override public void removeListener(ILabelProviderListener listener) { } }); updateTable.getTable().addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { if (event.detail == SWT.CHECK) { TableItem item = (TableItem) event.item; Update update = (Update) item.getData(); updates.put(update, !updates.get(update)); System.out.println(update + "=" + updates.get(update)); } } }); updateTable.setInput(updates.keySet()); updateTable.getTable().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); for (TableItem item : updateTable.getTable().getItems()) { item.setChecked(true); } Composite buttonsComposite = new Composite(main, SWT.NONE); buttonsComposite.setLayoutData(new GridData(GridData.END, GridData.FILL, true, true)); buttonsComposite.setLayout(new GridLayout(2, false)); Button selectAll = new Button(buttonsComposite, SWT.PUSH); selectAll.setText("Select All"); selectAll.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { for (TableItem item : updateTable.getTable().getItems()) { item.setChecked(true); } } }); return main; }
From source file:cc.warlock.scribe.ui.views.ScriptControlView.java
License:Open Source License
@Override public void createPartControl(Composite parent) { updateCurrentClient();/* w w w . ja va 2 s. c o m*/ main = new Composite(parent, SWT.NONE); GridLayout mainLayout = new GridLayout(2, false); mainLayout.marginHeight = mainLayout.marginWidth = 0; main.setLayout(mainLayout); main.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); Label label = new Label(main, SWT.NONE); label.setText("Running Scripts"); label.setFont(JFaceResources.getBannerFont()); }
From source file:com.architexa.org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog.java
License:Open Source License
/** * A convenient method to create CLabel titles (like the ones used in the * Preferences dialog in the Eclipse workbench) throughout the dialog. * /*from w w w . j a v a2s . c om*/ * @param composite The composite in which the title is to be created (it must have a * GridLayout with two columns). * @param text The title to be displayed * @return The newly created CLabel for convenience */ protected CLabel createSectionTitle(Composite composite, String text) { CLabel cTitle = new CLabel(composite, SWT.LEFT); Color background = JFaceColors.getBannerBackground(composite.getDisplay()); Color foreground = JFaceColors.getBannerForeground(composite.getDisplay()); JFaceColors.setColors(cTitle, foreground, background); cTitle.setFont(JFaceResources.getBannerFont()); cTitle.setText(text); cTitle.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); if (titleImage == null) { titleImage = new Image(composite.getDisplay(), ImageDescriptor .createFromFile(Internal.class, "icons/customizer_dialog_title.gif").getImageData()); //$NON-NLS-1$ composite.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { titleImage.dispose(); titleImage = null; } }); } Label imageLabel = new Label(composite, SWT.LEFT); imageLabel.setBackground(background); imageLabel.setImage(titleImage); imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); data.horizontalSpan = 2; separator.setLayoutData(data); return cTitle; }
From source file:com.astra.ses.spell.gui.dialogs.ControlInfoDialog.java
License:Open Source License
/*************************************************************************** * Constructor/*from w ww . j a v a 2 s. c o m*/ * * @param shell * The parent shell **************************************************************************/ public ControlInfoDialog(Shell shell, IProcedure proc) { super(shell); // Obtain the image for the dialog icon ImageDescriptor descr = Activator.getImageDescriptor("icons/dlg_exec.png"); m_image = descr.createImage(); m_font = JFaceResources.getBannerFont(); m_proc = proc; }
From source file:com.astra.ses.spell.gui.dialogs.DictionaryEditorDialog.java
License:Open Source License
/*************************************************************************** * Constructor/*from www . j a v a2 s . c o m*/ * * @param shell * The parent shell **************************************************************************/ public DictionaryEditorDialog(Shell shell, IProcedure model, String containerName, boolean canMergeFiles) { super(shell); // Obtain the image for the dialog icon ImageDescriptor descr = Activator.getImageDescriptor("icons/dlg_exec.png"); m_image = descr.createImage(); m_font = JFaceResources.getBannerFont(); m_procId = model.getProcId(); m_containerName = containerName; m_canMergeFiles = canMergeFiles; m_varTable = null; m_fileTable = null; m_readOnly = (!model.getRuntimeInformation().getClientMode().equals(ClientMode.CONTROLLING)); if (m_readOnly) m_canMergeFiles = false; loadData(false); m_fileContainer = new DataContainer(model.getProcId(), ""); }
From source file:com.astra.ses.spell.gui.dialogs.InputFileViewerDialog.java
License:Open Source License
/*************************************************************************** * Constructor//w w w . j av a 2 s.c o m * * @param shell * The parent shell **************************************************************************/ public InputFileViewerDialog(Shell shell) { super(shell); // Obtain the image for the dialog icon ImageDescriptor descr = Activator.getImageDescriptor("icons/dlg_exec.png"); m_image = descr.createImage(); m_font = JFaceResources.getBannerFont(); m_container = new DataContainer("<none>", ""); }