當前位置: 首頁>>代碼示例>>Java>>正文


Java ReorgDestinationFactory類代碼示例

本文整理匯總了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);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:18,代碼來源:DestinationContentProvider.java

示例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];
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:21,代碼來源:DestinationContentProvider.java

示例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;
	}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:19,代碼來源:SelectionTransferDropAdapter.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:19,代碼來源:JavaDropAdapterAssistant.java

示例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());
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:15,代碼來源:PasteAction.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:14,代碼來源:PasteAction.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:ReorgMoveWizard.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:SelectionTransferDropAdapter.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:12,代碼來源:SelectionTransferDropAdapter.java

示例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());
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:9,代碼來源:JavaDropAdapterAssistant.java

示例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());
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:9,代碼來源:JavaDropAdapterAssistant.java

示例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));
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:5,代碼來源:MoveRefactoringSession.java

示例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));
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:5,代碼來源:ReorgCopyWizard.java

示例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;
	}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:17,代碼來源:JavaDropAdapterAssistant.java


注:本文中的org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。