protected static Label createLabel(int numColumns, Composite parent, String text) { return createLabel(numColumns, parent, text, GridData.FILL_HORIZONTAL); }
@Override public void update(Observable o, Object arg) { doUpdatePreview(); notifyValuesModified(); } };
protected void focusLost() { updateStatus(null); final String input= fText.getText(); if (fInputValidator != null && fInputValidator.isValid(input) != null) fSelected= fOldSelected; else fSelected= input; if (fSelected != fOldSelected) { saveSelected(); fText.setText(fSelected); } }
layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); settingsPane.setLayout(layout); doCreatePreferences(settingsPane, numColumns); previewPane.setLayout(createGridLayout(numColumns, true)); previewPane.setFont(sashForm.getFont()); doCreatePreviewPane(previewPane, numColumns); initializePage();
/** * 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; }
super(preferences, key); fNumberLabel= createLabel(numColumns - 1, composite, text, GridData.FILL_HORIZONTAL); fNumberText= new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.RIGHT); fNumberText.setFont(composite.getFont()); fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));
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; }
@Override public final void makeVisible() { fDefaultFocusManager.resetFocus(); doUpdatePreview(); }
layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); settingsPane.setLayout(layout); doCreatePreferences(settingsPane, numColumns); previewPane.setLayout(createGridLayout(numColumns, true)); previewPane.setFont(sashForm.getFont()); doCreatePreviewPane(previewPane, numColumns); initializePage();
/** * 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; }
super(preferences, key); fNumberLabel= text == null ? null : createLabel(numColumns - 1, composite, text, GridData.FILL_HORIZONTAL); fNumberText= new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.RIGHT); fNumberText.setFont(composite.getFont()); fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));
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; }
/** * This is called when the page becomes visible. * Common tasks to do include: * <ul><li>Updating the preview.</li> * <li>Setting the focus</li> * </ul> */ final public void makeVisible() { fDefaultFocusManager.resetFocus(); doUpdatePreview(); }
layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); settingsPane.setLayout(layout); doCreatePreferences(settingsPane, numColumns); previewPane.setLayout(createGridLayout(numColumns, true)); previewPane.setFont(sashForm.getFont()); doCreatePreviewPane(previewPane, numColumns); initializePage();
/** * 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; }
super(preferences, key); fNumberLabel= text == null ? null : createLabel(numColumns - 1, composite, text, GridData.FILL_HORIZONTAL); fNumberText= new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.RIGHT); fNumberText.setFont(composite.getFont()); fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));
public void update(Observable o, Object arg) { doUpdatePreview(); notifyValuesModified(); } };
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 void focusLost() { updateStatus(null); final String input= fNumberText.getText(); if (!validInput(input)) fSelected= fOldSelected; else fSelected= Integer.parseInt(input); if (fSelected != fOldSelected) { saveSelected(); fNumberText.setText(Integer.toString(fSelected)); } }
@Override public final void makeVisible() { fDefaultFocusManager.resetFocus(); doUpdatePreview(); }