protected static Label createLabel(int numColumns, Composite parent, String text, int gridDataStyle) { final Label label= new Label(parent, SWT.WRAP); label.setFont(parent.getFont()); label.setText(text); PixelConverter pixelConverter= new PixelConverter(parent); label.setLayoutData(createGridData(numColumns, gridDataStyle, pixelConverter.convertHorizontalDLUsToPixels(150))); return label; }
protected static Label createLabel(int numColumns, Composite parent, String text, int gridDataStyle) { final Label label= new Label(parent, SWT.WRAP); label.setFont(parent.getFont()); label.setText(text); PixelConverter pixelConverter= new PixelConverter(parent); label.setLayoutData(createGridData(numColumns, gridDataStyle, pixelConverter.convertHorizontalDLUsToPixels(150))); return label; }
protected static Label createLabel(int numColumns, Composite parent, String text, int gridDataStyle) { final Label label= new Label(parent, SWT.WRAP); label.setFont(parent.getFont()); label.setText(text); PixelConverter pixelConverter= new PixelConverter(parent); label.setLayoutData(createGridData(numColumns, gridDataStyle, pixelConverter.convertHorizontalDLUsToPixels(150))); return label; }
/** * Create a new CheckboxPreference. * @param composite The composite on which the SWT widgets are added. * @param numColumns The number of columns in the composite's GridLayout. * @param preferences The map to store the values. * @param key The key to store the values. * @param values An array of two elements indicating the values to store on unchecked/checked. * @param text The label text for this Preference. * @param style SWT style flag for the button */ public ButtonPreference(Composite composite, int numColumns, Map preferences, String key, String [] values, String text, int style) { super(preferences, key); if (values == null || text == null) throw new IllegalArgumentException(FormatterMessages.ModifyDialogTabPage_error_msg_values_text_unassigned); fValues= values; fCheckbox= new Button(composite, style); fCheckbox.setText(text); fCheckbox.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT)); fCheckbox.setFont(composite.getFont()); updateWidget(); fCheckbox.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { checkboxChecked(((Button)e.widget).getSelection()); } }); }
/** * Create a new CheckboxPreference. * @param composite The composite on which the SWT widgets are added. * @param numColumns The number of columns in the composite's GridLayout. * @param preferences The map to store the values. * @param key The key to store the values. * @param values An array of two elements indicating the values to store on unchecked/checked. * @param text The label text for this Preference. * @param style SWT style flag for the button */ public ButtonPreference(Composite composite, int numColumns, Map<String, String> preferences, String key, String [] values, String text, int style) { super(preferences, key); if (values == null || text == null) throw new IllegalArgumentException(FormatterMessages.ModifyDialogTabPage_error_msg_values_text_unassigned); fValues= values; fCheckbox= new Button(composite, style); fCheckbox.setText(text); fCheckbox.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT)); fCheckbox.setFont(composite.getFont()); updateWidget(); fCheckbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { checkboxChecked(((Button)e.widget).getSelection()); } }); }
/** * Create a new CheckboxPreference. * @param composite The composite on which the SWT widgets are added. * @param numColumns The number of columns in the composite's GridLayout. * @param preferences The map to store the values. * @param key The key to store the values. * @param values An array of two elements indicating the values to store on unchecked/checked. * @param text The label text for this Preference. * @param style SWT style flag for the button */ public ButtonPreference(Composite composite, int numColumns, Map<String, String> preferences, String key, String [] values, String text, int style) { super(preferences, key); if (values == null || text == null) throw new IllegalArgumentException(FormatterMessages.ModifyDialogTabPage_error_msg_values_text_unassigned); fValues= values; fCheckbox= new Button(composite, style); fCheckbox.setText(text); fCheckbox.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT)); fCheckbox.setFont(composite.getFont()); updateWidget(); fCheckbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { checkboxChecked(((Button)e.widget).getSelection()); } }); }
fLabel.setText(text); fLabel.setLayoutData(createGridData(numColumns - 1, GridData.HORIZONTAL_ALIGN_BEGINNING, SWT.DEFAULT)); fText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_BEGINNING, fPixelConverter.convertWidthInCharsToPixels(length)));
fLabel.setText(text); fLabel.setLayoutData(createGridData(numColumns - 1, GridData.HORIZONTAL_ALIGN_BEGINNING, SWT.DEFAULT)); fText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_BEGINNING, fPixelConverter.convertWidthInCharsToPixels(length)));
fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));
fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));
fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));
if (items[i].length() > max) max= items[i].length(); fCombo.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_FILL, fCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x));
protected Group createGroup(int numColumns, Composite parent, String text ) { final Group group= new Group(parent, SWT.NONE); group.setFont(parent.getFont()); group.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT)); final GridLayout layout= new GridLayout(numColumns, false); layout.verticalSpacing= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); //layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); //layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); group.setLayout(layout);//createGridLayout(numColumns, true)); group.setText(text); return group; }
protected Group createGroup(int numColumns, Composite parent, String text ) { final Group group= new Group(parent, SWT.NONE); group.setFont(parent.getFont()); group.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT)); final GridLayout layout= new GridLayout(numColumns, false); layout.verticalSpacing= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); //layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); //layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); group.setLayout(layout);//createGridLayout(numColumns, true)); group.setText(text); return group; }
protected Group createGroup(int numColumns, Composite parent, String text ) { final Group group= new Group(parent, SWT.NONE); group.setFont(parent.getFont()); group.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT)); final GridLayout layout= new GridLayout(numColumns, false); layout.verticalSpacing= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); //layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); //layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); group.setLayout(layout);//createGridLayout(numColumns, true)); group.setText(text); return group; }
if (items[i].length() > max) max= items[i].length(); fCombo.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_FILL, fCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x));
/** * Create the right side of the modify dialog. By default, the preview is displayed there. * Subclasses can override this method in order to customize the right-hand side of the * dialog. * @param composite Composite to create in * @param numColumns Number of columns to use * @return Created composite */ protected Composite doCreatePreviewPane(Composite composite, int numColumns) { createLabel(numColumns, composite, FormatterMessages.ModifyDialogTabPage_preview_label_text); final JavaPreview preview= doCreateJavaPreview(composite); fDefaultFocusManager.add(preview.getControl()); final GridData gd= createGridData(numColumns, GridData.FILL_BOTH, 0); gd.widthHint= 0; gd.heightHint=0; preview.getControl().setLayoutData(gd); return composite; }
/** * Create the right side of the modify dialog. By default, the preview is displayed there. * Subclasses can override this method in order to customize the right-hand side of the * dialog. * @param composite Composite to create in * @param numColumns Number of columns to use * @return Created composite */ protected Composite doCreatePreviewPane(Composite composite, int numColumns) { createLabel(numColumns, composite, FormatterMessages.ModifyDialogTabPage_preview_label_text); final JavaPreview preview= doCreateJavaPreview(composite); fDefaultFocusManager.add(preview.getControl()); final GridData gd= createGridData(numColumns, GridData.FILL_BOTH, 0); gd.widthHint= 0; gd.heightHint=0; preview.getControl().setLayoutData(gd); return composite; }
/** * Create the right side of the modify dialog. By default, the preview is displayed there. * Subclasses can override this method in order to customize the right-hand side of the * dialog. * @param composite Composite to create in * @param numColumns Number of columns to use * @return Created composite */ protected Composite doCreatePreviewPane(Composite composite, int numColumns) { createLabel(numColumns, composite, FormatterMessages.ModifyDialogTabPage_preview_label_text); final JavaPreview preview= doCreateJavaPreview(composite); fDefaultFocusManager.add(preview.getControl()); final GridData gd= createGridData(numColumns, GridData.FILL_BOTH, 0); gd.widthHint= 0; gd.heightHint=0; preview.getControl().setLayoutData(gd); return composite; }
if (items[i].length() > max) max= items[i].length(); fCombo.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_FILL, fCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x));