@Override protected void doSetFocus() { viewer.getControl().setFocus(); }
@Override protected void doSetFocus() { viewer.getControl().setFocus(); }
protected void doSetFocus() { viewer.getControl().setFocus(); }
/** * Set the enablement state of the widget. * @param enabled */ public void setEnabled(boolean enabled) { fileSystemTitle.setEnabled(enabled); fileSystems.getControl().setEnabled(enabled); } }
/** * Set the enablement state of the widget. * @param enabled The new state to be set. */ public void setEnabled(boolean enabled) { fileSystemTitle.setEnabled(enabled); fileSystems.getControl().setEnabled(enabled); } }
/** * The <code>ComboBoxCellEditor</code> implementation of this * <code>CellEditor</code> framework method sets the minimum width of the * cell. The minimum width is 10 characters if <code>comboBox</code> is * not <code>null</code> or <code>disposed</code> eles it is 60 pixels * to make sure the arrow button and some text is visible. The list of * CCombo will be wide enough to show its longest item. */ public LayoutData getLayoutData() { LayoutData layoutData = super.getLayoutData(); if ((viewer.getControl() == null) || viewer.getControl().isDisposed()) { layoutData.minimumWidth = 60; } else { // make the comboBox 10 characters wide GC gc = new GC(viewer.getControl()); layoutData.minimumWidth = (gc.getFontMetrics() .getAverageCharWidth() * 10) + 10; gc.dispose(); } return layoutData; }
/** * The <code>ComboBoxCellEditor</code> implementation of this * <code>CellEditor</code> framework method sets the minimum width of the * cell. The minimum width is 10 characters if <code>comboBox</code> is * not <code>null</code> or <code>disposed</code> eles it is 60 pixels * to make sure the arrow button and some text is visible. The list of * CCombo will be wide enough to show its longest item. */ @Override public LayoutData getLayoutData() { LayoutData layoutData = super.getLayoutData(); if ((viewer.getControl() == null) || viewer.getControl().isDisposed()) { layoutData.minimumWidth = 60; } else { // make the comboBox 10 characters wide GC gc = new GC(viewer.getControl()); layoutData.minimumWidth = (gc.getFontMetrics() .getAverageCharWidth() * 10) + 10; gc.dispose(); } return layoutData; }
/** * The <code>ComboBoxCellEditor</code> implementation of this * <code>CellEditor</code> framework method sets the minimum width of the * cell. The minimum width is 10 characters if <code>comboBox</code> is * not <code>null</code> or <code>disposed</code> eles it is 60 pixels * to make sure the arrow button and some text is visible. The list of * CCombo will be wide enough to show its longest item. */ @Override public LayoutData getLayoutData() { LayoutData layoutData = super.getLayoutData(); if ((viewer.getControl() == null) || viewer.getControl().isDisposed()) { layoutData.minimumWidth = 60; } else { // make the comboBox 10 characters wide GC gc = new GC(viewer.getControl()); layoutData.minimumWidth = (gc.getFontMetrics() .getAverageCharWidth() * 10) + 10; gc.dispose(); } return layoutData; }
fDecorationViewer.getControl().setEnabled(enabled);
private boolean isPerformRevert() { Shell shell= viewer.getControl().getShell(); MessageDialog dialog= new MessageDialog(shell, TextEditorMessages.SpellingConfigurationBlock_error_title, null, TextEditorMessages.SpellingConfigurationBlock_error_message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1); return dialog.open() == 0; }
private boolean isPerformRevert() { Shell shell= viewer.getControl().getShell(); MessageDialog dialog= new MessageDialog(shell, TextEditorMessages.SpellingConfigurationBlock_error_title, null, TextEditorMessages.SpellingConfigurationBlock_error_message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1); return dialog.open() == 0; }
fDecorationViewer.getControl().setEnabled(enabled);
private void updateDecorationViewer(ListItem item, boolean changed) { // decoration selection: if the checkbox is enabled, there is // only one case where the combo is not enabled: if both the highlight and textStyle keys are null final boolean enabled= fShowInTextCheckBox.getSelection() && !(item.highlightKey == null && item.textStyleKey == null); fDecorationViewer.getControl().setEnabled(enabled); if (changed) { String[] selection= null; ArrayList<String[]> list= new ArrayList<>(); list.addAll(item.validStyles); if (getPreferenceStore().getBoolean(item.highlightKey)) selection= HIGHLIGHT; // set selection if (selection == null) { String val= getPreferenceStore().getString(item.textStyleKey); for (Iterator<String[]> iter= list.iterator(); iter.hasNext();) { String[] elem= iter.next(); if (elem[1].equals(val)) { selection= elem; break; } } } fDecorationViewer.setInput(list.toArray(new Object[list.size()])); if (selection == null) selection= list.get(0); fDecorationViewer.setSelection(new StructuredSelection((Object) selection), true); } }
fDecorationViewer.getControl().setEnabled(enabled);
this.contextSelector.getControl ().setEnabled ( false ); this.userText.setEnabled ( false ); this.passwordText.setEnabled ( false );
/** * Load the current state from the dialog settings */ private void loadFrom () { this.flagCredentialsAsProperties = this.dialogSettings.getBoolean ( SETTING_AS_PROPERTIES ); final String user = this.dialogSettings.get ( SETTING_USER ); final String contextId = this.dialogSettings.get ( SETTING_CONTEXT ); if ( user != null && contextId != null ) { this.userText.setText ( user ); for ( final LoginContext context : this.contexts ) { if ( context.getId ().equals ( contextId ) ) { this.contextSelector.setSelection ( new StructuredSelection ( context ), true ); } } this.passwordText.setFocus (); } else { this.contextSelector.getControl ().setFocus (); } }
protected void handleComplete ( final Collection<LoginHandler> result ) { if ( this.creator == null ) { logger.error ( "Creating is null but we got a result. This should also never happen!" ); //$NON-NLS-1$ return; } this.creator.dispose (); this.creator = null; if ( result == null ) { final Button button = getButton ( OK ); button.setEnabled ( true ); this.contextSelector.getControl ().setEnabled ( true ); this.userText.setEnabled ( true ); this.passwordText.setEnabled ( true ); } else { saveTo (); Activator.getDefault ().setLoginSession ( this.user, this.password, this.loginContext, result ); super.okPressed (); } }
fileSystems.getControl().setFont(composite.getFont());
private void createColorsAndFontsThemeCombo(Composite composite) { new Label(composite, SWT.NONE).setText(WorkbenchMessages.ViewsPreference_currentTheme); colorsAndFontsThemeCombo = new ComboViewer(composite, SWT.READ_ONLY); colorsAndFontsThemeCombo.getControl().setLayoutData( new GridData(SWT.FILL, SWT.CENTER, true, false)); colorsAndFontsThemeCombo.setLabelProvider(new LabelProvider() { colorsAndFontsThemeCombo.setContentProvider(new ArrayContentProvider()); colorsAndFontsThemeCombo.setInput(getColorsAndFontsThemes()); colorsAndFontsThemeCombo.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); colorsAndFontsThemeCombo.addSelectionChangedListener(event -> { ColorsAndFontsTheme colorsAndFontsTheme = getSelectedColorsAndFontsTheme();
fileSystems.getControl().setFont(composite.getFont());