private Label createLabel(String text) { final GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= NUM_COLUMNS; gd.widthHint= convertWidthInCharsToPixels(60); final Label label= new Label(fComposite, SWT.WRAP); label.setText(text); label.setLayoutData(gd); return label; }
@Override public void modifyText(ModifyEvent e) { doValidation(); } });
public Control createDialogArea(Composite parent) { initializeComposite(parent); createLabel(Messages.format(FormatterMessages.AlreadyExistsDialog_dialog_label, fProfile.getName())); fRenameRadio= createRadioButton(FormatterMessages.AlreadyExistsDialog_rename_radio_button_desc); fNameText= createTextField(); fOverwriteRadio= createRadioButton(FormatterMessages.AlreadyExistsDialog_overwrite_radio_button_desc); updateStatus(fDuplicate); applyDialogFont(fComposite);
final AlreadyExistsDialog aeDialog= new AlreadyExistsDialog(fComposite.getShell(), profile, fProfileManager); if (aeDialog.open() != Window.OK) return;
@Override protected void okPressed() { if (!getStatus().isOK()) return; if (fRenameRadio.getSelection()) fProfile.rename(fNameText.getText().trim(), fProfileManager); super.okPressed(); } }
public AlreadyExistsDialog(Shell parentShell, CustomProfile profile, ProfileManager profileManager) { super(parentShell); fProfile= profile; fProfileManager= profileManager; fOk= new StatusInfo(); fDuplicate= new StatusInfo(IStatus.ERROR, FormatterMessages.AlreadyExistsDialog_message_profile_already_exists); fEmpty= new StatusInfo(IStatus.ERROR, FormatterMessages.AlreadyExistsDialog_message_profile_name_empty); setHelpAvailable(false); }
((GridLayout) fComposite.getLayout()).numColumns= NUM_COLUMNS; createLabel(Messages.format(FormatterMessages.AlreadyExistsDialog_dialog_label, fProfile.getName())); fRenameRadio= createRadioButton(FormatterMessages.AlreadyExistsDialog_rename_radio_button_desc); fNameText= createTextField(); fOverwriteRadio= createRadioButton(FormatterMessages.AlreadyExistsDialog_overwrite_radio_button_desc); updateStatus(fDuplicate); applyDialogFont(fComposite);
final AlreadyExistsDialog aeDialog= new AlreadyExistsDialog(fComposite.getShell(), profile, fProfileManager); if (aeDialog.open() != Window.OK) return;
protected void okPressed() { if (!getStatus().isOK()) return; if (fRenameRadio.getSelection()) fProfile.rename(fNameText.getText().trim(), fProfileManager); super.okPressed(); } }
public AlreadyExistsDialog(Shell parentShell, CustomProfile profile, ProfileManager profileManager) { super(parentShell); fProfile= profile; fProfileManager= profileManager; fOk= new StatusInfo(); fDuplicate= new StatusInfo(IStatus.ERROR, FormatterMessages.AlreadyExistsDialog_message_profile_already_exists); fEmpty= new StatusInfo(IStatus.ERROR, FormatterMessages.AlreadyExistsDialog_message_profile_name_empty); setHelpAvailable(false); }
((GridLayout) fComposite.getLayout()).numColumns= NUM_COLUMNS; createLabel(Messages.format(FormatterMessages.AlreadyExistsDialog_dialog_label, fProfile.getName())); fRenameRadio= createRadioButton(FormatterMessages.AlreadyExistsDialog_rename_radio_button_desc); fNameText= createTextField(); fOverwriteRadio= createRadioButton(FormatterMessages.AlreadyExistsDialog_overwrite_radio_button_desc); updateStatus(fDuplicate); applyDialogFont(fComposite);
final AlreadyExistsDialog aeDialog= new AlreadyExistsDialog(fComposite.getShell(), profile, fProfileManager); if (aeDialog.open() != Window.OK) return;
@Override public void modifyText(ModifyEvent e) { doValidation(); } });
private Label createLabel(String text) { final GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= NUM_COLUMNS; gd.widthHint= convertWidthInCharsToPixels(60); final Label label= new Label(fComposite, SWT.WRAP); label.setText(text); label.setLayoutData(gd); return label; }
@Override protected void okPressed() { if (!getStatus().isOK()) return; if (fRenameRadio.getSelection()) fProfile.rename(fNameText.getText().trim(), fProfileManager); super.okPressed(); } }
public AlreadyExistsDialog(Shell parentShell, CustomProfile profile, ProfileManager profileManager) { super(parentShell); fProfile= profile; fProfileManager= profileManager; fOk= new StatusInfo(); fDuplicate= new StatusInfo(IStatus.ERROR, FormatterMessages.AlreadyExistsDialog_message_profile_already_exists); fEmpty= new StatusInfo(IStatus.ERROR, FormatterMessages.AlreadyExistsDialog_message_profile_name_empty); setHelpAvailable(false); }
public void modifyText(ModifyEvent e) { doValidation(); } });
private Label createLabel(String text) { final GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= NUM_COLUMNS; gd.widthHint= convertWidthInCharsToPixels(60); final Label label= new Label(fComposite, SWT.WRAP); label.setText(text); label.setLayoutData(gd); return label; }
public void widgetSelected(SelectionEvent e) { fNameText.setEnabled(false); doValidation(); } public void widgetDefaultSelected(SelectionEvent e) {
private Button createRadioButton(String text) { final GridData gd = new GridData(); gd.horizontalSpan = NUM_COLUMNS; gd.widthHint= convertWidthInCharsToPixels(60); final Button radio= new Button(fComposite, SWT.RADIO); radio.setLayoutData(gd); radio.setText(text); return radio; }