本文整理匯總了Java中org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory類的典型用法代碼示例。如果您正苦於以下問題:Java ReorgDestinationFactory類的具體用法?Java ReorgDestinationFactory怎麽用?Java ReorgDestinationFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ReorgDestinationFactory類屬於org.eclipse.jdt.internal.corext.refactoring.reorg包,在下文中一共展示了ReorgDestinationFactory類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: hasChildren
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
public boolean hasChildren(Object element) {
IReorgDestination destination= ReorgDestinationFactory.createDestination(element);
if (!fValidator.canChildrenBeDestinations(destination))
return false;
if (element instanceof IJavaElement){
IJavaElement javaElement= (IJavaElement) element;
if (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT) {
IPackageFragmentRoot root= (IPackageFragmentRoot) javaElement;
if (root.isArchive() || root.isExternal())
return false;
}
}
return super.hasChildren(element);
}
示例2: getChildren
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
public Object[] getChildren(Object element) {
try {
if (element instanceof IJavaModel) {
return concatenate(getJavaProjects((IJavaModel)element), getOpenNonJavaProjects((IJavaModel)element));
} else {
Object[] children= doGetChildren(element);
ArrayList<Object> result= new ArrayList<Object>(children.length);
for (int i= 0; i < children.length; i++) {
IReorgDestination destination= ReorgDestinationFactory.createDestination(children[i]);
if (fValidator.canElementBeDestination(destination) || fValidator.canChildrenBeDestinations(destination))
result.add(children[i]);
}
return result.toArray();
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
return new Object[0];
}
}
示例3: handleValidateCopy
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private int handleValidateCopy(Object target) throws JavaModelException{
if (fCopyProcessor == null) {
final ICopyPolicy policy= ReorgPolicyFactory.createCopyPolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements));
fCopyProcessor= policy.canEnable() ? new JavaCopyProcessor(policy) : null;
}
if (!canCopyElements())
return DND.DROP_NONE;
if (fCopyProcessor == null)
return DND.DROP_NONE;
if (!fCopyProcessor.setDestination(ReorgDestinationFactory.createDestination(target, getCurrentLocation())).isOK())
return DND.DROP_NONE;
return DND.DROP_COPY;
}
示例4: handleValidateMove
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private int handleValidateMove(Object target) throws JavaModelException {
if (target == null)
return DND.DROP_NONE;
IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements));
fMoveProcessor= (policy.canEnable()) ? new JavaMoveProcessor(policy) : null;
if (!canMoveElements())
return DND.DROP_NONE;
if (fMoveProcessor == null)
return DND.DROP_NONE;
if (!fMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(target)).isOK())
return DND.DROP_NONE;
return DND.DROP_MOVE;
}
示例5: paste
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
public void paste(IJavaElement[] javaElements, IResource[] resources, IWorkingSet[] selectedWorkingSets, TransferData[] availableTypes) throws JavaModelException, InterruptedException, InvocationTargetException{
IResource[] clipboardResources= getClipboardResources(availableTypes);
if (clipboardResources == null)
clipboardResources= new IResource[0];
IJavaElement[] clipboardJavaElements= getClipboardJavaElements(availableTypes);
if (clipboardJavaElements == null)
clipboardJavaElements= new IJavaElement[0];
Object destination= getTarget(javaElements, resources);
Assert.isNotNull(destination);
Assert.isLegal(clipboardResources.length + clipboardJavaElements.length > 0);
ReorgCopyStarter.create(clipboardJavaElements, clipboardResources, ReorgDestinationFactory.createDestination(destination)).run(getShell());
}
示例6: canPasteOn
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
public boolean canPasteOn(IJavaElement[] javaElements, IResource[] resources, IWorkingSet[] selectedWorkingSets, List<?> selectedElements) throws JavaModelException {
if (selectedWorkingSets.length != 0)
return false;
IResource[] clipboardResources= getClipboardResources(fAvailableTypes);
if (clipboardResources == null)
clipboardResources= new IResource[0];
IJavaElement[] clipboardJavaElements= getClipboardJavaElements(fAvailableTypes);
if (clipboardJavaElements == null)
clipboardJavaElements= new IJavaElement[0];
Object destination= getTarget(javaElements, resources);
return ReorgCopyStarter.create(clipboardJavaElements, clipboardResources, ReorgDestinationFactory.createDestination(destination)) != null;
}
示例7: verifyDestination
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
protected RefactoringStatus verifyDestination(Object selected) throws JavaModelException{
JavaMoveProcessor processor= getJavaMoveProcessor();
final RefactoringStatus refactoringStatus= processor.setDestination(ReorgDestinationFactory.createDestination(selected));
updateUIStatus();
fDestination= selected;
return refactoringStatus;
}
示例8: handleDropMove
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private boolean handleDropMove(final Object target) throws JavaModelException, InvocationTargetException, InterruptedException{
IJavaElement[] javaElements= ReorgUtils.getJavaElements(fElements);
IResource[] resources= ReorgUtils.getResources(fElements);
ReorgMoveStarter starter= ReorgMoveStarter.create(javaElements, resources, ReorgDestinationFactory.createDestination(target, getCurrentLocation()));
if (starter != null)
return starter.run(getShell());
return false;
}
示例9: handleDropCopy
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private boolean handleDropCopy(final Object target) throws JavaModelException, InvocationTargetException, InterruptedException{
IJavaElement[] javaElements= ReorgUtils.getJavaElements(fElements);
IResource[] resources= ReorgUtils.getResources(fElements);
ReorgCopyStarter starter= ReorgCopyStarter.create(javaElements, resources, ReorgDestinationFactory.createDestination(target, getCurrentLocation()));
if (starter != null) {
starter.run(getShell());
return true;
}
return false;
}
示例10: handleDropMove
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private void handleDropMove(final Object target) throws JavaModelException, InvocationTargetException, InterruptedException {
IJavaElement[] javaElements = ReorgUtils.getJavaElements(fElements);
IResource[] resources = ReorgUtils.getResources(fElements);
ReorgMoveStarter starter= ReorgMoveStarter.create(javaElements, resources, ReorgDestinationFactory.createDestination(target));
if (starter != null)
starter.run(getShell());
}
示例11: handleDropCopy
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private void handleDropCopy(final Object target) throws JavaModelException, InvocationTargetException, InterruptedException {
IJavaElement[] javaElements = ReorgUtils.getJavaElements(fElements);
IResource[] resources = ReorgUtils.getResources(fElements);
ReorgCopyStarter starter = ReorgCopyStarter.create(javaElements, resources, ReorgDestinationFactory.createDestination(target));
if (starter != null)
starter.run(getShell());
}
示例12: verifyDestination
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
public RefactoringStatus verifyDestination(Object selected) throws JavaModelException {
return processor.setDestination(ReorgDestinationFactory.createDestination(selected));
}
示例13: verifyDestination
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
@Override
protected RefactoringStatus verifyDestination(Object selected) throws JavaModelException{
return getCopyProcessor().setDestination(ReorgDestinationFactory.createDestination(selected));
}
示例14: handleValidateCopy
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory; //導入依賴的package包/類
private int handleValidateCopy(Object target) throws JavaModelException {
final ICopyPolicy policy= ReorgPolicyFactory.createCopyPolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements));
fCopyProcessor= policy.canEnable() ? new JavaCopyProcessor(policy) : null;
if (!canCopyElements())
return DND.DROP_NONE;
if (fCopyProcessor == null)
return DND.DROP_NONE;
if (!fCopyProcessor.setDestination(ReorgDestinationFactory.createDestination(target)).isOK())
return DND.DROP_NONE;
return DND.DROP_COPY;
}