List of usage examples for org.eclipse.jface.dialogs Dialog applyDialogFont
public static void applyDialogFont(Control control)
From source file:de.walware.statet.nico.internal.ui.actions.AbstractHistoryPage.java
License:Open Source License
@Override public void createControl(final Composite parent) { initializeDialogUnits(parent);/*from ww w. j a v a 2 s .c o m*/ final Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setLayout(LayoutUtil.createContentGrid(1)); fLocationGroup = createResourceInputComposite(composite); fLocationGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); fLocationGroup.setHistory(getDialogSettings().getArray(SETTINGS_HISTORY)); fLocationGroup.addModifyListener(new ModifyListener() { @Override public void modifyText(final ModifyEvent e) { validate(); } }); final Composite contentOptions = createContentOptions(composite); if (contentOptions != null) { contentOptions.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); } final Composite saveOptions = createSaveOptions(composite); if (saveOptions != null) { saveOptions.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); } LayoutUtil.addSmallFiller(composite, true); final ToolInfoGroup info = new ToolInfoGroup(composite, fTool); info.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); Dialog.applyDialogFont(composite); setControl(composite); initFields(); isIntialized = true; validate(); setErrorMessage(null); setMessage(null); }
From source file:de.walware.statet.r.internal.cmd.ui.launching.RCmdMainTab.java
License:Open Source License
@Override public void createControl(final Composite parent) { final Composite mainComposite = new Composite(parent, SWT.NONE); setControl(mainComposite);//from w w w .ja v a 2 s . c om mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); mainComposite.setLayout(new GridLayout()); Group group; group = new Group(mainComposite, SWT.NONE); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); group.setText(RCmdMessages.RCmd_MainTab_Cmd_label); createCommandControls(group); final Label note = new Label(mainComposite, SWT.WRAP); note.setText(SharedMessages.Note_label + ": " + fArgumentsControl.getNoteText()); //$NON-NLS-1$ note.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, true)); Dialog.applyDialogFont(parent); initBindings(); }
From source file:de.walware.statet.r.internal.console.ui.launching.ExtJavaJRETab.java
License:Open Source License
@Override public void createControl(final Composite parent) { super.createControl(parent); final Composite tabHolder = getDynamicTabHolder(); final Composite composite = tabHolder.getParent(); final GridLayout layout = (GridLayout) composite.getLayout(); tabHolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, layout.numColumns, 1)); final Composite extComposite = new Composite(composite, SWT.NONE); final GridLayout extLayout = new GridLayout(); extLayout.marginHeight = 0;// w w w. j a v a2 s .c o m extComposite.setLayout(extLayout); extComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, layout.numColumns, 1)); final Group group = new Group(extComposite, SWT.NONE); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); group.setLayout(LayoutUtil.applyGroupDefaults(new GridLayout(), 1)); group.setText(RConsoleMessages.JavaJRE_Tab_VMConfig_group); fVmArgsControl = new InputArgumentsComposite(group, RConsoleMessages.JavaJRE_Tab_VMArguments_label); fVmArgsControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); fVmArgsControl.getTextControl().addModifyListener(new ModifyListener() { @Override public void modifyText(final ModifyEvent e) { updateLaunchConfigurationDialog(); } }); final Label note = new Label(group, SWT.WRAP); note.setText(fVmArgsControl.getNoteText()); note.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); Dialog.applyDialogFont(extComposite); }
From source file:de.walware.statet.r.internal.console.ui.launching.RConsoleMainTab.java
License:Open Source License
@Override public void createControl(final Composite parent) { final Composite mainComposite = new Composite(parent, SWT.NONE); setControl(mainComposite);// ww w .j ava2 s . c om mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); mainComposite.setLayout(new GridLayout()); { // Type final Composite composite = new Composite(mainComposite, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); composite.setLayout(LayoutUtil.applyCompositeDefaults(new GridLayout(), 2)); final Label label = new Label(composite, SWT.LEFT); label.setText(RConsoleMessages.RConsole_MainTab_LaunchType_label + ':'); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); final String[] names = new String[fTypes.length]; for (int i = 0; i < fTypes.length; i++) { names[i] = fTypes[i].getName(); } fTypesCombo = new ComboViewer(composite, SWT.DROP_DOWN | SWT.READ_ONLY); fTypesCombo.setContentProvider(new ArrayContentProvider()); fTypesCombo.setLabelProvider(new LabelProvider() { @Override public String getText(final Object element) { final RConsoleType type = (RConsoleType) element; return type.getName(); } }); fTypesCombo.setInput(fTypes); fTypesCombo.getCombo().setVisibleItemCount(names.length); fTypesCombo.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fTypesCombo.getControl().setEnabled(fTypes.length > 1); } final Composite detailGroup = createTypeDetailGroup(mainComposite); if (detailGroup != null) { detailGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); } final Composite commandGroup = createROptionsGroup(mainComposite); commandGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); LayoutUtil.addSmallFiller(mainComposite, true); createFooter(mainComposite); Dialog.applyDialogFont(parent); initBindings(); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IRConsoleHelpContextIds.R_CONSOLE_LAUNCH); }
From source file:de.walware.statet.r.internal.console.ui.launching.RConsoleOptionsTab.java
License:Open Source License
@Override public void createControl(final Composite parent) { final Composite mainComposite = new Composite(parent, SWT.NONE); setControl(mainComposite);//from w w w . j av a 2 s . co m mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); mainComposite.setLayout(GridLayoutFactory.swtDefaults().create()); final Composite consoleComposite = createConsoleOptions(mainComposite); if (consoleComposite != null) { consoleComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); } final Composite trackingComposite = createTrackingOptions(mainComposite); if (trackingComposite != null) { trackingComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } { // Snippet options: final Group group = new Group(mainComposite, SWT.NONE); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 4)); group.setText("R snippet run after startup:"); createSnippetOptions(group); } { // Object DB options: final Group group = new Group(mainComposite, SWT.NONE); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); group.setText("Eclipse Integration:"); createEclipseOptions(group); } Dialog.applyDialogFont(parent); initBindings(); fTrackingButtons.updateState(); }
From source file:de.walware.statet.r.internal.console.ui.launching.RRemoteConsoleSelectionDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { // page group final Composite area = (Composite) super.createDialogArea(parent); createMessageArea(area);//from w w w . j av a 2 s. c o m final IDialogSettings dialogSettings = getDialogSettings(); { final Composite composite = new Composite(area, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); composite.setLayout(LayoutUtil.applyCompositeDefaults(new GridLayout(), 3)); final Label label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); label.setText(RConsoleMessages.RRemoteConsoleSelectionDialog_Hostname_label); fHostAddressControl = new Combo(composite, SWT.DROP_DOWN); final GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); gd.widthHint = LayoutUtil.hintWidth(fHostAddressControl, 50); fHostAddressControl.setLayoutData(gd); final String[] history = dialogSettings.getArray(SETTINGS_HOST_HISTORY_KEY); if (history != null) { fHistoryAddress.addAll(Arrays.asList(history)); } fHostAddressControl.addSelectionListener(new SelectionAdapter() { @Override public void widgetDefaultSelected(final SelectionEvent e) { update(); } }); final Button goButton = new Button(composite, SWT.PUSH); goButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); goButton.setText(RConsoleMessages.RRemoteConsoleSelectionDialog_Update_label); goButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { update(); } }); } { final TreeComposite composite = new TreeComposite(area, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); final GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); gd.heightHint = LayoutUtil.hintHeight(composite.tree, 10); composite.setLayoutData(gd); fRServerViewer = composite.viewer; composite.tree.setHeaderVisible(true); ColumnViewerToolTipSupport.enableFor(composite.viewer); { final TreeViewerColumn column = new TreeViewerColumn(fRServerViewer, SWT.NONE); column.getColumn().setText(RConsoleMessages.RRemoteConsoleSelectionDialog_Table_UserOrEngine_label); composite.layout.setColumnData(column.getColumn(), new ColumnWeightData(1)); column.setLabelProvider(new RemoteRLabelProvider() { @Override public void update(final ViewerCell cell) { final Object element = cell.getElement(); String text = null; Image image = null; if (element instanceof String) { text = (String) element; image = SharedUIResources.getImages().get(SharedUIResources.OBJ_USER_IMAGE_ID); } else if (element instanceof RemoteR) { text = getText((RemoteR) element); } cell.setText(text); cell.setImage(image); } @Override public String getText(final RemoteR r) { return r.info.getName(); } }); } { final TreeViewerColumn column = new TreeViewerColumn(fRServerViewer, SWT.NONE); column.getColumn().setText(RConsoleMessages.RRemoteConsoleSelectionDialog_Table_Host_label); composite.layout.setColumnData(column.getColumn(), new ColumnWeightData(1)); column.setLabelProvider(new RemoteRLabelProvider() { @Override public String getText(final RemoteR r) { return r.hostName; } }); } fRServerViewer.setContentProvider(new RemoteRContentProvider()); fRServerViewer.getTree().addSelectionListener(new SelectionListener() { @Override public void widgetSelected(final SelectionEvent e) { updateState(); } @Override public void widgetDefaultSelected(final SelectionEvent e) { updateState(); if (getOkButton().isEnabled()) { buttonPressed(IDialogConstants.OK_ID); } } }); } Dialog.applyDialogFont(area); updateInput(); if (fRServerList != null) { updateStatus(new Status(IStatus.OK, RConsoleUIPlugin.PLUGIN_ID, RConsoleMessages.RRemoteConsoleSelectionDialog_info_ListRestored_message)); } return area; }
From source file:de.walware.statet.r.internal.ui.pkgmanager.StatusPage.java
License:Open Source License
@Override public void createControl(final Composite parent) { initializeDialogUnits(parent);/*from w ww . java2s . co m*/ final Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setLayout(LayoutUtil.createContentGrid(1)); { final Label label = new Label(composite, SWT.NONE); label.setText("&Issues:"); label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); } { final Control detail = createDetailArea(composite); detail.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } if (fAllowIgnore) { final Button button = new Button(composite, SWT.CHECK); fIgnoreControl = button; button.setText("Ignore shown issues and continue."); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { updateState(); } }); button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); } Dialog.applyDialogFont(composite); setControl(composite); setStatus(fStatus); }
From source file:de.walware.statet.r.internal.ui.pkgmanager.SummaryPage.java
License:Open Source License
@Override public void createControl(final Composite parent) { initializeDialogUnits(parent);/* w ww . j a v a2 s.c o m*/ final Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setLayout(LayoutUtil.createContentGrid(1)); { final Label label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); label.setText("Packages to install:"); } fTable = new TableComposite(composite, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL); fTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); fTable.viewer.setContentProvider(ArrayContentProvider.getInstance()); { final TableViewerColumn column = fTable.addColumn("Name", SWT.LEFT, new ColumnWeightData(60, true)); column.setLabelProvider(new CellLabelProvider() { @Override public void update(final ViewerCell cell) { final RPkgAction action = (RPkgAction) cell.getElement(); cell.setText(action.getPkg().getName()); } }); } { final TableViewerColumn column = fTable.addColumn("", SWT.LEFT, new ColumnPixelData(LayoutUtil.hintColWidth(fTable.table, 10), true, true)); column.setLabelProvider(new CellLabelProvider() { @Override public void update(final ViewerCell cell) { final RPkgAction action = (RPkgAction) cell.getElement(); cell.setText(fResolver.getReason(action.getPkg())); } }); } { final TableViewerColumn column = fTable.addColumn("Version", SWT.LEFT, new ColumnPixelData(LayoutUtil.hintColWidth(fTable.table, 10), true, true)); column.setLabelProvider(new CellLabelProvider() { @Override public void update(final ViewerCell cell) { final RPkgAction action = (RPkgAction) cell.getElement(); cell.setText(action.getPkg().getVersion().toString()); } }); } { final TableViewerColumn column = fTable.addColumn("From", SWT.LEFT, new ColumnWeightData(40, true)); column.setLabelProvider(new CellLabelProvider() { @Override public void update(final ViewerCell cell) { final RPkgAction action = (RPkgAction) cell.getElement(); final RRepo repo = fPkgManager.getRepo(action.getRepoId()); if (repo.getPkgType() != null) { final StringBuilder sb = new StringBuilder(repo.getName()); sb.append(" ("); sb.append(repo.getPkgType().getLabel()); sb.append(")"); cell.setText(sb.toString()); } else { cell.setText(repo.getName()); } } }); } { final TableViewerColumn column = fTable.addColumn("To", SWT.LEFT, new ColumnWeightData(40, true)); column.setLabelProvider(new CellLabelProvider() { @Override public void update(final ViewerCell cell) { cell.setText( REnvLabelProvider.getSafeLabel(((RPkgAction) cell.getElement()).getLibraryLocation())); } }); } fTable.table.setHeaderVisible(true); fTable.table.setLinesVisible(true); Dialog.applyDialogFont(composite); setControl(composite); }
From source file:de.walware.statet.r.internal.ui.rhelp.PackageSelectionDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { final Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setLayout(LayoutUtil.createDialogGrid(1)); initializeDialogUnits(composite);//from w w w . j a v a 2 s .c o m createMessageArea(composite); fFilterText = new SearchText(composite); fFilterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fFilterText.setToolTipText("Filter"); final CheckboxTableComposite tableComposite = new CheckboxTableComposite(composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.VIRTUAL); final GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); data.heightHint = LayoutUtil.hintHeight(tableComposite.table, 10); data.widthHint = LayoutUtil.hintWidth(tableComposite.table, 40); tableComposite.setLayoutData(data); fViewer = tableComposite.viewer; final TableViewerColumn column = tableComposite.addColumn("Name", SWT.LEFT, new ColumnWeightData(1)); column.setLabelProvider(new RHelpLabelProvider()); ColumnViewerToolTipSupport.enableFor(tableComposite.viewer); fViewer.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(final CheckStateChangedEvent event) { final Object element = event.getElement(); if (element instanceof IRPkgHelp) { final IRPkgHelp pkg = (IRPkgHelp) element; if (!fSelection.remove(pkg)) { fSelection.add(pkg); } } } }); fViewer.setCheckStateProvider(new ICheckStateProvider() { @Override public boolean isGrayed(final Object element) { return false; } @Override public boolean isChecked(final Object element) { return fSelection.contains(element); } }); fFilterController = new TableFilterController(fViewer); { final TextElementFilter filter = new TextElementFilter(); fFilterController.setFilter(0, filter); new SearchTextBinding(fFilterText, fFilterController, filter); } fFilterController.setInput(fInput); ViewerUtil.installSearchTextNavigation(fViewer, fFilterText, true); final Button clearAllControl = new Button(composite, SWT.PUSH); final GridData gd = new GridData(SWT.LEFT, SWT.CENTER, false, false); gd.widthHint = LayoutUtil.hintWidth(clearAllControl); clearAllControl.setLayoutData(gd); clearAllControl.setText(Messages.PackageSelection_ClearAll_label); clearAllControl.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { fSelection.clear(); fViewer.refresh(); } }); Dialog.applyDialogFont(composite); return composite; }
From source file:de.walware.statet.r.internal.ui.RProjectContainerComposite.java
License:Open Source License
/** * Creates the contents of the composite. * //from www. j av a 2 s .c o m * @param heightHint height hint for the drill down composite */ public void createContents() { setLayout(LayoutUtil.applyCompositeDefaults(new GridLayout(), 1)); setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); createTreeViewer(); Dialog.applyDialogFont(this); }