public static IStatus validateProjectName(String projectName) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IStatus status = workspace.validateName(projectName, IResource.PROJECT); if (!status.isOK()) return status; return OK_STATUS; }
/** * Throws an exception if the given path is not valid as a path variable * value. */ private void checkIsValidValue(URI newValue) throws CoreException { IStatus status = validateValue(newValue); if (!status.isOK()) throw new CoreException(status); }
@Override public IStatus setVisibility(IElementDescriptor element, int visibility) { for (int i = 0; i < fDescriptions.length; i++) { IStatus status = fDescriptions[i].setVisibility(element, visibility); if (status.isOK() || i == (fDescriptions.length - 1)) { return status; } } return Status.CANCEL_STATUS; }
String getMessageText(IStatus currentStatus) { if (currentStatus == null || currentStatus.isOK()) return getDescription(); if (currentStatus.getSeverity() == IStatus.CANCEL) return ProvUIMessages.ResolutionWizardPage_Canceled; if (currentStatus.getSeverity() == IStatus.ERROR) return ProvUIMessages.ResolutionWizardPage_ErrorStatus; return ProvUIMessages.ResolutionWizardPage_WarningInfoStatus; }
/** * Return true if this server can currently be acted on. * @return boolean * @param server org.eclipse.wst.server.core.IServer */ public boolean accept(IServer server) { return server.canPublish().isOK(); }
protected void okPressed() { if (!getStatus().isOK()) return; if (fRenameRadio.getSelection()) fProfile.rename(fNameText.getText().trim(), fProfileManager); super.okPressed(); } }
public static boolean validateEdit(IFile[] files) { if(files == null || files.length == 0){ return true; } ISimpleValidateEditContext validator = (ISimpleValidateEditContext) UIContextDetermination.createInstance(ISimpleValidateEditContext.CLASS_KEY); return validator.validateEdit(files).isOK(); }
private static boolean checkInSync(IResource[] resources, Shell parent, String title) { IStatus status= Resources.checkInSync(resources); if (status.isOK()) return true; ErrorDialog.openError(parent, title, JavaUIMessages.ElementValidator_cannotPerform, status); return false; }
@Override public IStatus computeUndoableStatus(IProgressMonitor monitor) { IStatus status = super.computeUndoableStatus(monitor); if (status.isOK()) { status = computeMoveOrCopyStatus(); } return status; } }
@Override public IStatus computeExecutionStatus(IProgressMonitor monitor) { IStatus status = super.computeExecutionStatus(monitor); if (status.isOK()) { status = computeCreateStatus(true); } return status; }
@Override public IStatus computeUndoableStatus(IProgressMonitor monitor) { IStatus status = super.computeUndoableStatus(monitor); if (status.isOK()) { status = computeDeleteStatus(); } return status; }
@Override public IStatus computeExecutionStatus(IProgressMonitor monitor) { IStatus status = getBasicRedoStatus(); if (status.isOK()) { return super.computeExecutionStatus(monitor); } if (status.getSeverity() == IStatus.ERROR) { markInvalid(); } return status; }
@Override public IStatus computeRedoableStatus(IProgressMonitor monitor) { IStatus status = getBasicRedoStatus(); if (status.isOK()) { return super.computeRedoableStatus(monitor); } if (status.getSeverity() == IStatus.ERROR) { markInvalid(); } return status; }
@Override public int getRelevance() { IStatus status = getFixStatus(); if (status != null && !status.isOK()) { return super.getRelevance() - 100; } else { return super.getRelevance(); } }
public static void startRenameRefactoring(final IJavaElement element, final Shell shell) throws CoreException { final RenameSupport support= createRenameSupport(element, null, RenameSupport.UPDATE_REFERENCES); if (support != null && support.preCheck().isOK()) support.openDialog(shell); }
@Override public int getRelevance() { IStatus status= getFixStatus(); if (status != null && !status.isOK()) { return super.getRelevance() - 100; } else { return super.getRelevance(); } }
protected void assertMoveRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkMoveRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
@Override protected IStatus computeMoveOrCopyStatus() { IStatus status = Status.OK_STATUS; if (projectLocation != null) { status = getWorkspace().validateProjectLocationURI(getProject(), projectLocation); } if (status.isOK()) { return super.computeMoveOrCopyStatus(); } return status; }
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (!validateEdit().isOK()) return Status.CANCEL_STATUS; if (model.getBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_COMPONENT_REF)) { addReferencedComponents(monitor); } if (model.getBooleanProperty(CreateOptionalReferenceOpDataModelProvider.CREATE_PROJECT_REF)) { addProjectReferences(); } return OK_STATUS; }
private boolean performValidateEdit(ICompilationUnit unit) { IStatus status= Resources.makeCommittable(unit.getResource(), JavaPlugin.getActiveWorkbenchShell()); if (!status.isOK()) { String label= CorrectionMessages.CUCorrectionProposal_error_title; String message= CorrectionMessages.CUCorrectionProposal_error_message; ErrorDialog.openError(JavaPlugin.getActiveWorkbenchShell(), label, message, status); return false; } return true; }