@Override public void changeControlPressed(DialogField field) { if (field == fResourceBundleFile) { browseForPropertyFile(); } else if (field == fAccessorClassName) { browseForAccessorClass(); } } }
/** * checks all entered values delegates to the specific validate methods these methods * update the refactoring */ private void validateAll() { validateSubstitutionPattern(); validateAccessorClassName(); checkPackageFragment(); validatePropertyFilename(); validatePropertyPackage(); updateStatus(StatusUtil.getMostSevere(fStati)); }
protected Control createDialogArea(Composite ancestor) { Composite parent= (Composite) super.createDialogArea(ancestor); final int nOfColumns= 4; initializeDialogUnits(ancestor); GridLayout layout= (GridLayout) parent.getLayout(); layout.numColumns= nOfColumns; parent.setLayout(layout); createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40)); Separator s= new Separator(SWT.SEPARATOR | SWT.HORIZONTAL); s.doFillIntoGrid(parent, nOfColumns); createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40)); Dialog.applyDialogFont(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE); validateAll(); return parent; }
public NLSAccessorConfigurationDialog(Shell parent, NLSRefactoring refactoring) { super(parent); setShellStyle(getShellStyle() | SWT.RESIZE); setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_title); cu, updateListener, refactoring.getAccessorClassPackage()); fAccessorClassName= createStringButtonField(NLSUIMessages.NLSAccessorConfigurationDialog_className, NLSUIMessages.NLSAccessorConfigurationDialog_browse6, updateListener); fSubstitutionPattern= createStringField(NLSUIMessages.NLSAccessorConfigurationDialog_substitutionPattern, updateListener); cu, updateListener, fRefactoring.getResourceBundlePackage()); fResourceBundleFile= createStringButtonField(NLSUIMessages.NLSAccessorConfigurationDialog_property_file_name, NLSUIMessages.NLSAccessorConfigurationDialog_browse5, updateListener); initFields();
fStati= new IStatus[] { StatusInfo.OK_STATUS, StatusInfo.OK_STATUS, StatusInfo.OK_STATUS, StatusInfo.OK_STATUS, StatusInfo.OK_STATUS }; setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_title); cu, updateListener, refactoring.getAccessorClassPackage()); fAccessorClassName= createStringButtonField(NLSUIMessages.NLSAccessorConfigurationDialog_className, NLSUIMessages.NLSAccessorConfigurationDialog_browse6, updateListener); fSubstitutionPattern= createStringField(NLSUIMessages.NLSAccessorConfigurationDialog_substitutionPattern, updateListener); cu, updateListener, fRefactoring.getResourceBundlePackage()); fResourceBundleFile= createStringButtonField(NLSUIMessages.NLSAccessorConfigurationDialog_property_file_name, NLSUIMessages.NLSAccessorConfigurationDialog_browse5, updateListener); initFields();
private void createPropertyPart(Composite parent, final int nOfColumns, final int textWidth) { createLabel(parent, NLSUIMessages.NLSAccessorConfigurationDialog_property_location, nOfColumns); fResourceBundlePackage.createControl(parent, nOfColumns, textWidth); fResourceBundleFile.doFillIntoGrid(parent, nOfColumns); LayoutUtil.setWidthHint(fResourceBundleFile.getTextControl(null), convertWidthInCharsToPixels(60)); }
private void doConfigureButtonPressed() { NLSAccessorConfigurationDialog dialog= new NLSAccessorConfigurationDialog(getShell(), fNLSRefactoring); if (dialog.open() == Window.OK) { NLSSubstitution.updateSubtitutions(fSubstitutions, getProperties(fNLSRefactoring.getPropertyFileHandle()), fNLSRefactoring.getAccessorClassName()); if (fIsEclipseNLS != null) { fIsEclipseNLS.setSelection(fNLSRefactoring.isEclipseNLS()); fIsEclipseNLS.setEnabled(willCreateAccessorClass()); } validateKeys(true); updateAccessorChoices(); } }
private void browseForPropertyFile() { ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider()); dialog.setIgnoreCase(false); dialog.setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_Property_File_Selection); dialog.setMessage(NLSUIMessages.NLSAccessorConfigurationDialog_Choose_the_property_file); dialog.setElements(createFileListInput()); dialog.setFilter('*' + NLSRefactoring.PROPERTY_FILE_EXT); if (dialog.open() == Window.OK) { IFile selectedFile= (IFile) dialog.getFirstResult(); if (selectedFile != null) fResourceBundleFile.setText(selectedFile.getName()); } }
@Override protected Control createDialogArea(Composite ancestor) { Composite parent= (Composite) super.createDialogArea(ancestor); final int nOfColumns= 4; initializeDialogUnits(ancestor); GridLayout layout= (GridLayout) parent.getLayout(); layout.numColumns= nOfColumns; parent.setLayout(layout); createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40)); Separator s= new Separator(SWT.SEPARATOR | SWT.HORIZONTAL); s.doFillIntoGrid(parent, nOfColumns); createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40)); Dialog.applyDialogFont(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE); validateAll(); return parent; }
fStati= new IStatus[] { StatusInfo.OK_STATUS, StatusInfo.OK_STATUS, StatusInfo.OK_STATUS, StatusInfo.OK_STATUS, StatusInfo.OK_STATUS }; setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_title); cu, updateListener, refactoring.getAccessorClassPackage()); fAccessorClassName= createStringButtonField(NLSUIMessages.NLSAccessorConfigurationDialog_className, NLSUIMessages.NLSAccessorConfigurationDialog_browse6, updateListener); fSubstitutionPattern= createStringField(NLSUIMessages.NLSAccessorConfigurationDialog_substitutionPattern, updateListener); cu, updateListener, fRefactoring.getResourceBundlePackage()); fResourceBundleFile= createStringButtonField(NLSUIMessages.NLSAccessorConfigurationDialog_property_file_name, NLSUIMessages.NLSAccessorConfigurationDialog_browse5, updateListener); initFields();
private void createPropertyPart(Composite parent, final int nOfColumns, final int textWidth) { createLabel(parent, NLSUIMessages.NLSAccessorConfigurationDialog_property_location, nOfColumns); fResourceBundlePackage.createControl(parent, nOfColumns, textWidth); fResourceBundleFile.doFillIntoGrid(parent, nOfColumns); LayoutUtil.setWidthHint(fResourceBundleFile.getTextControl(null), convertWidthInCharsToPixels(60)); }
private void doConfigureButtonPressed() { NLSAccessorConfigurationDialog dialog= new NLSAccessorConfigurationDialog(getShell(), fNLSRefactoring); if (dialog.open() == Window.OK) { NLSSubstitution.updateSubtitutions(fSubstitutions, getProperties(fNLSRefactoring.getPropertyFileHandle()), fNLSRefactoring.getAccessorClassName()); if (fIsEclipseNLS != null) { fIsEclipseNLS.setSelection(fNLSRefactoring.isEclipseNLS()); fIsEclipseNLS.setEnabled(willCreateAccessorClass()); } validateKeys(true); updateAccessorChoices(); } }
private void browseForPropertyFile() { ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider()); dialog.setIgnoreCase(false); dialog.setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_Property_File_Selection); dialog.setMessage(NLSUIMessages.NLSAccessorConfigurationDialog_Choose_the_property_file); dialog.setElements(createFileListInput()); dialog.setFilter('*' + NLSRefactoring.PROPERTY_FILE_EXT); if (dialog.open() == Window.OK) { IFile selectedFile= (IFile) dialog.getFirstResult(); if (selectedFile != null) fResourceBundleFile.setText(selectedFile.getName()); } }
/** * checks all entered values delegates to the specific validate methods these methods * update the refactoring */ private void validateAll() { validateSubstitutionPattern(); validateAccessorClassName(); checkPackageFragment(); validatePropertyFilename(); validatePropertyPackage(); updateStatus(StatusUtil.getMostSevere(fStati)); }
@Override protected Control createDialogArea(Composite ancestor) { Composite parent= (Composite) super.createDialogArea(ancestor); final int nOfColumns= 4; initializeDialogUnits(ancestor); GridLayout layout= (GridLayout) parent.getLayout(); layout.numColumns= nOfColumns; parent.setLayout(layout); createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40)); Separator s= new Separator(SWT.SEPARATOR | SWT.HORIZONTAL); s.doFillIntoGrid(parent, nOfColumns); createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40)); Dialog.applyDialogFont(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE); validateAll(); return parent; }
private void createPropertyPart(Composite parent, final int nOfColumns, final int textWidth) { createLabel(parent, NLSUIMessages.NLSAccessorConfigurationDialog_property_location, nOfColumns); fResourceBundlePackage.createControl(parent, nOfColumns, textWidth); fResourceBundleFile.doFillIntoGrid(parent, nOfColumns); LayoutUtil.setWidthHint(fResourceBundleFile.getTextControl(null), convertWidthInCharsToPixels(60)); }
private void doConfigureButtonPressed() { NLSAccessorConfigurationDialog dialog= new NLSAccessorConfigurationDialog(getShell(), fNLSRefactoring); if (dialog.open() == Window.OK) { NLSSubstitution.updateSubtitutions(fSubstitutions, getProperties(fNLSRefactoring.getPropertyFileHandle()), fNLSRefactoring.getAccessorClassName()); if (fIsEclipseNLS != null) { fIsEclipseNLS.setSelection(fNLSRefactoring.isEclipseNLS()); fIsEclipseNLS.setEnabled(willCreateAccessorClass()); } validateKeys(true); updateAccessorChoices(); } }
private void browseForPropertyFile() { ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider()); dialog.setIgnoreCase(false); dialog.setTitle(NLSUIMessages.NLSAccessorConfigurationDialog_Property_File_Selection); dialog.setMessage(NLSUIMessages.NLSAccessorConfigurationDialog_Choose_the_property_file); dialog.setElements(createFileListInput()); dialog.setFilter('*' + NLSRefactoring.PROPERTY_FILE_EXT); if (dialog.open() == Window.OK) { IFile selectedFile= (IFile) dialog.getFirstResult(); if (selectedFile != null) fResourceBundleFile.setText(selectedFile.getName()); } }
public void changeControlPressed(DialogField field) { if (field == fResourceBundleFile) { browseForPropertyFile(); } else if (field == fAccessorClassName) { browseForAccessorClass(); } } }
/** * checks all entered values delegates to the specific validate methods these methods * update the refactoring */ private void validateAll() { validateSubstitutionPattern(); validateAccessorClassName(); checkPackageFragment(); validatePropertyFilename(); validatePropertyPackage(); updateStatus(StatusUtil.getMostSevere(fStati)); }