@Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite) super.createDialogArea(parent); Composite contents = new Composite(parentComposite, SWT.NONE); contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); setTitle(headerTitle); setMessage(message2); new Label(contents, SWT.LEFT) .setText(label); filenameField = new Text(contents, SWT.SINGLE | SWT.BORDER); if (initialValue != null) { filenameField.setText(initialValue); } filenameField.addModifyListener(event -> { if (event.widget == filenameField) { filename = filenameField.getText().trim(); okButton.setEnabled(validateFileType()); } }); filenameField.setFocus(); Dialog.applyDialogFont(parentComposite); Point defaultMargins = LayoutConstants.getMargins(); GridLayoutFactory.fillDefaults().numColumns(2).margins( defaultMargins.x, defaultMargins.y).generateLayout(contents); return contents; }
@Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite) super.createDialogArea(parent); Composite contents = new Composite(parentComposite, SWT.NONE); contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); setTitle(headerTitle); setMessage(message2); new Label(contents, SWT.LEFT) .setText(label); filenameField = new Text(contents, SWT.SINGLE | SWT.BORDER); if (initialValue != null) { filenameField.setText(initialValue); } filenameField.addModifyListener(event -> { if (event.widget == filenameField) { filename = filenameField.getText().trim(); okButton.setEnabled(validateFileType()); } }); filenameField.setFocus(); Dialog.applyDialogFont(parentComposite); Point defaultMargins = LayoutConstants.getMargins(); GridLayoutFactory.fillDefaults().numColumns(2).margins( defaultMargins.x, defaultMargins.y).generateLayout(contents); return contents; }
public TabAdvanced(TabFolder folder, int index, final Shell shell) { TabItem tab = new TabItem(folder, SWT.NONE, index); tab.setText(SecUIMessages.tabAdvanced); Composite page = new Composite(folder, SWT.NONE); tab.setControl(page); Label cipherLabel = new Label(page, SWT.NONE); cipherLabel.setText(SecUIMessages.selectCipher); cipherSelector = new Combo(page, SWT.READ_ONLY | SWT.DROP_DOWN); GridData gridDataSelector = new GridData(GridData.FILL, GridData.BEGINNING, true, false); cipherSelector.setLayoutData(gridDataSelector); // initialize values eclipseNode = ConfigurationScope.INSTANCE.getNode(PREFERENCES_PLUGIN); defaultCipherAlgorithm = eclipseNode.get(IStorageConstants.CIPHER_KEY, IStorageConstants.DEFAULT_CIPHER); availableCiphers = InternalExchangeUtils.ciphersDetectAvailable(); // fill cipher selector int position = 0; for (Iterator<String> i = availableCiphers.keySet().iterator(); i.hasNext();) { String cipherAlgorithm = i.next(); cipherSelector.add(cipherAlgorithm, position); if (defaultCipherAlgorithm.equals(cipherAlgorithm)) cipherSelector.select(position); position++; } GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()).numColumns(1).generateLayout(page); }
public TabAdvanced(TabFolder folder, int index, final Shell shell) { TabItem tab = new TabItem(folder, SWT.NONE, index); tab.setText(SecUIMessages.tabAdvanced); Composite page = new Composite(folder, SWT.NONE); tab.setControl(page); Label cipherLabel = new Label(page, SWT.NONE); cipherLabel.setText(SecUIMessages.selectCipher); cipherSelector = new Combo(page, SWT.READ_ONLY | SWT.DROP_DOWN); GridData gridDataSelector = new GridData(GridData.FILL, GridData.BEGINNING, true, false); cipherSelector.setLayoutData(gridDataSelector); // initialize values eclipseNode = new ConfigurationScope().getNode(PREFERENCES_PLUGIN); defaultCipherAlgorithm = eclipseNode.get(IStorageConstants.CIPHER_KEY, IStorageConstants.DEFAULT_CIPHER); availableCiphers = InternalExchangeUtils.ciphersDetectAvailable(); // fill cipher selector int position = 0; for (Iterator i = availableCiphers.keySet().iterator(); i.hasNext();) { String cipherAlgorithm = (String) i.next(); cipherSelector.add(cipherAlgorithm, position); if (defaultCipherAlgorithm.equals(cipherAlgorithm)) cipherSelector.select(position); position++; } GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()).numColumns(1).generateLayout(page); }
Point defaultMargins = LayoutConstants.getMargins(); GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y) .generateLayout(contents);
protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
@Override protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
@Override protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }