@Override public String getLabel() { String label= JavaElementLabels.getTextLabel(fElement, JavaElementLabels.ALL_DEFAULT | JavaElementLabels.ALL_FULLY_QUALIFIED); return Messages.format(JavaUIMessages.JavaUIHelp_link_label, label); } }
@Override public Object getAdditionalProposalInfo(IProgressMonitor monitor) { return Messages.format(CorrectionMessages.ReorgCorrectionsSubProcessor_project_seup_fix_info, BasicElementLabels.getJavaElementName(fModuleSearchStr)); } }
public String getResultLabel(int nMatches) { if (nMatches == 1) { return Messages.format(fSingularLabel, new Object[] { fName, BasicElementLabels.getFileName(fElement) }); } else { return Messages.format(fPluralLabel, new Object[] { fName, Integer.valueOf(nMatches), BasicElementLabels.getFileName(fElement) }); } }
public String getSubTaskMessage(ICompilationUnit source) { String typeName= BasicElementLabels.getFileName(source); return Messages.format(FixMessages.CleanUpRefactoring_ProcessingCompilationUnit_message, new Object[] {Integer.valueOf(getIndex()), Integer.valueOf(fSize), typeName}); } }
@Override protected String getStatusFieldText() { TriggerSequence[] sequences= getInvokingCommandKeySequences(); if (sequences == null || sequences.length == 0) return ""; //$NON-NLS-1$ String keySequence= sequences[0].format(); if (fOutlineContentProvider.isShowingInheritedMembers()) return Messages.format(JavaUIMessages.JavaOutlineControl_statusFieldText_hideInheritedMembers, keySequence); else return Messages.format(JavaUIMessages.JavaOutlineControl_statusFieldText_showInheritedMembers, keySequence); }
private Status createAPIViolationStatus(String operation) { String disable= createBlameMessage(); Object[] args= {operation}; String reason= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_reason_API, args); return new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, disable + " " + reason, null); //$NON-NLS-1$ }
private Status createPerformanceStatus(String operation) { String disable= createBlameMessage(); Object[] args= {operation}; String reason= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_reason_performance, args); return new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, disable + " " + reason, null); //$NON-NLS-1$ }
private String createBlameMessage() { Object[] args= { getName(), getId() }; String disable= Messages.format(JavaTextMessages.ProposalSorterHandle_blame, args); return disable; }
private static boolean skip(String name, IConfirmQuery overwriteQuery){ String question= Messages.format(RefactoringCoreMessages.OverwriteHelper_3, BasicElementLabels.getJavaElementName(name)); return overwriteQuery.confirm(question); } }
@Override public String getText(Object element) { NonNLSElement nlsel= (NonNLSElement)element; String elementName= BasicElementLabels.getPathLabel(nlsel.cu.getResource().getFullPath(), false); return Messages.format( ActionMessages.FindStringsToExternalizeAction_foundStrings, new Object[] {Integer.valueOf(nlsel.count), elementName} ); } @Override
private IStatus computeSourceModuleStatus(String value) { StatusInfo status= new StatusInfo(); if (value.isEmpty()) { status.setError(NewWizardMessages.ModuleAddExportsBlock_sourceModuleEmpty_error); return status; } if (moduleNames().contains(value)) { return status; } status.setError(Messages.format(NewWizardMessages.ModuleAddExportsBlock_wrongSourceModule_error, value)); return status; }
@Override public String getName() { IJavaElement javaElement= getJavaElement(getSourceManipulation()); return Messages.format(RefactoringCoreMessages.DeleteSourceManipulationChange_0, JavaElementLabels.getElementLabel(javaElement, JavaElementLabels.ALL_DEFAULT)); }
public static CompilationUnitRewriteOperationsFix createIndirectAccessToStaticFix(CompilationUnit compilationUnit, IProblemLocation problem) { if (!isIndirectStaticAccess(problem)) return null; ToStaticAccessOperation operations[]= createToStaticAccessOperations(compilationUnit, new HashMap<ASTNode, Block>(), problem, false); if (operations == null) return null; String label= Messages.format(FixMessages.CodeStyleFix_ChangeStaticAccess_description, operations[0].getAccessorName()); return new CodeStyleFix(label, compilationUnit, new CompilationUnitRewriteOperation[] {operations[0]}); }
@Override public String getLabel() { return fQuery.getSpecification().size() == 1 ? fQuery.getResultLabel(getMatchCount()) : Messages.format(SearchMessages.JavaSearchQuery_multi_selection_search_description, fQuery.getResultLabel(getMatchCount())); }
@Override public String getName() { String[] keys= new String[] { BasicElementLabels.getJavaElementName(getOldName()), BasicElementLabels.getJavaElementName(getNewName())}; return Messages.format(RefactoringCoreMessages.RenameCompilationUnitChange_name, keys); } }
/** * Creates a new remove linked folder dialog. * * @param shell the parent shell to use * @param folder the linked folder to remove */ RemoveLinkedFolderDialog(final Shell shell, final IFolder folder) { super(shell, NewWizardMessages.ClasspathModifierQueries_confirm_remove_linked_folder_label, null, Messages.format(NewWizardMessages.ClasspathModifierQueries_confirm_remove_linked_folder_message, new Object[] { BasicElementLabels.getPathLabel(folder.getFullPath(), false)}), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 0); // yes is the default Assert.isTrue(folder.isLinked()); }
public boolean canActionBeAdded() { Object element= SelectionUtil.getSingleElement(getSelection()); if (element instanceof IType) { IType type= (IType)element; setText(Messages.format( TypeHierarchyMessages.FocusOnSelectionAction_label, JavaElementLabels.getTextLabel(type, 0))); return true; } return false; } }
public static NullAnnotationsFix createAddMissingDefaultNullnessAnnotationsFix(CompilationUnit compilationUnit, IProblemLocation problem) { AddMissingDefaultNullnessRewriteOperation operation= new AddMissingDefaultNullnessRewriteOperation(compilationUnit, problem); String nonNullByDefaultAnnotationname= NullAnnotationsFix.getNonNullByDefaultAnnotationName(compilationUnit.getJavaElement(), true); String label= Messages.format(FixMessages.NullAnnotationsRewriteOperations_add_missing_default_nullness_annotation, new String[] { nonNullByDefaultAnnotationname }); return new NullAnnotationsFix(label, compilationUnit, new AddMissingDefaultNullnessRewriteOperation[] { operation }); }
NonNLSListDialog(Shell parent, NonNLSElement[] input, int count) { super(parent); setAddCancelButton(false); setInput(Arrays.asList(input)); setTitle(ActionMessages.ExternalizeStringsAction_dialog_title); String message= count == 1 ? ActionMessages.FindStringsToExternalizeAction_non_externalized_singular : Messages.format( ActionMessages.FindStringsToExternalizeAction_non_externalized_plural, new Object[] { Integer.valueOf(count) }); setMessage(message); setContentProvider(new ArrayContentProvider()); setLabelProvider(createLabelProvider()); }
@Override public void run(ITextSelection selection) { ICompilationUnit compilationUnit= SelectionConverter.getInputAsCompilationUnit(fEditor); IJavaProject javaProject= compilationUnit.getJavaProject(); if (!JavaModelUtil.is17OrHigher(javaProject)) { String message= Messages.format(RefactoringMessages.SurroundWithTryMultiCatchAction_not17, BasicElementLabels.getJavaElementName(javaProject.getElementName())); MessageDialog.openInformation(JavaPlugin.getActiveWorkbenchShell(), getDialogTitle(), message); return; } super.run(selection); }