if (accessorClass == null || !isEclipseNLSUsed(accessorClass)) return false;
if (accessorClass == null || !isEclipseNLSUsed(accessorClass)) return false;
if (accessorClass == null || !isEclipseNLSUsed(accessorClass)) return false;
if (accessorClass == null || !isEclipseNLSUsed(accessorClass)) return false;
private static boolean getRenameKeysProposals(PropertiesAssistContext invocationContext, ArrayList<ICompletionProposal> resultingCollections) throws BadLocationException, BadPartitioningException { ISourceViewer sourceViewer= invocationContext.getSourceViewer(); IDocument document= invocationContext.getDocument(); int selectionOffset= invocationContext.getOffset(); int selectionLength= invocationContext.getLength(); IField field= null; IType accessorClass= invocationContext.getAccessorType(); if (accessorClass == null || !isEclipseNLSUsed(accessorClass)) return false; List<String> keys= getKeysFromSelection(document, selectionOffset, selectionLength); if (keys == null || keys.size() != 1) return false; field= accessorClass.getField(keys.get(0)); if (!field.exists()) return false; if (resultingCollections == null) return true; String name= PropertiesFileEditorMessages.PropertiesCorrectionProcessor_rename_in_workspace; resultingCollections.add(new RenameKeyProposal(name, 5, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE), field, sourceViewer.getTextWidget().getShell())); return true; }
private static boolean getRenameKeysProposals(PropertiesAssistContext invocationContext, ArrayList<ICompletionProposal> resultingCollections) throws BadLocationException, BadPartitioningException { ISourceViewer sourceViewer= invocationContext.getSourceViewer(); IDocument document= invocationContext.getDocument(); int selectionOffset= invocationContext.getOffset(); int selectionLength= invocationContext.getLength(); IField field= null; IType accessorClass= invocationContext.getAccessorType(); if (accessorClass == null || !isEclipseNLSUsed(accessorClass)) return false; List<String> keys= getKeysFromSelection(document, selectionOffset, selectionLength); if (keys == null || keys.size() != 1) return false; field= accessorClass.getField(keys.get(0)); if (!field.exists()) return false; if (resultingCollections == null) return true; String name= PropertiesFileEditorMessages.PropertiesCorrectionProcessor_rename_in_workspace; resultingCollections.add(new RenameKeyProposal(name, 5, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE), field, sourceViewer.getTextWidget().getShell())); return true; }