/** {@inheritDoc} */ public void open(PharPackage jarPackage, Shell displayShell, MultiStatus statusMsg) throws CoreException { super.open(jarPackage, displayShell, statusMsg); fJarPackage = jarPackage; Assert.isTrue( fJarPackage.isValid(), "The PHAR package specification is invalid"); // $NON-NLS-1$ if (!canCreateJar(displayShell)) throw new OperationCanceledException(); try { fileExporter = PharExportHelper.createFileExporter(fJarPackage); } catch (IOException ex) { throw PharUIUtil.createCoreException(ex.getLocalizedMessage(), ex); } // fJarWriter= new PharWriter3(fJarPackage, displayShell); }
/** * Checks whether the given move included is vaild * * @param destination * @return a staus indicating whether the included is valid or not */ public RefactoringStatus verifyDestination(IResource destination) { RefactoringStatus status = new RefactoringStatus(); Assert.isNotNull(destination); if (!destination.exists() || destination.isPhantom()) return RefactoringStatus.createFatalErrorStatus( PhpRefactoringCoreMessages.getString("MoveDelegate.2")); // $NON-NLS-1$ if (!destination.isAccessible()) return RefactoringStatus.createFatalErrorStatus( PhpRefactoringCoreMessages.getString("MoveDelegate.3")); // $NON-NLS-1$ Assert.isTrue(destination.getType() != IResource.ROOT); IResource[] sourceResources = fProcessor.getSourceSelection(); for (IResource element : sourceResources) { if (destination.equals(element.getParent())) return RefactoringStatus.createFatalErrorStatus( PhpRefactoringCoreMessages.getString("MoveDelegate.4")); // $NON-NLS-1$ if (destination.equals(element)) { return RefactoringStatus.createFatalErrorStatus( PhpRefactoringCoreMessages.getString("MoveDelegate.5")); // $NON-NLS-1$ } } return status; }