当前位置: 首页>>代码示例>>Java>>正文


Java IUndoableOperation.getLabel方法代码示例

本文整理汇总了Java中org.eclipse.core.commands.operations.IUndoableOperation.getLabel方法的典型用法代码示例。如果您正苦于以下问题:Java IUndoableOperation.getLabel方法的具体用法?Java IUndoableOperation.getLabel怎么用?Java IUndoableOperation.getLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.commands.operations.IUndoableOperation的用法示例。


在下文中一共展示了IUndoableOperation.getLabel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addContributorOperations

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public static IUndoableOperation addContributorOperations(IUndoableOperation operation, EObject target, 
		EStructuralFeature feature, Object oldValue, Object newValue) {
	if (!CONTRIBUTORS.isEmpty()) {
		CompositeOperation toDoList = new CompositeOperation(operation.getLabel());
		toDoList.add(operation);
		for (UpdateValueOperationContributor contributor : CONTRIBUTORS) {
			contributor.contributeOperations(toDoList, target, feature, oldValue, newValue);
		}
		return toDoList;
	}
	return operation;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:13,代码来源:EMFUtils.java

示例2: addContributorOperations

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public static IUndoableOperation addContributorOperations(IUndoableOperation operation, IPlanElementTransferable transferable, PlanStructureLocation location) {
	if (!CONTRIBUTORS.isEmpty()) {
		CompositeOperation toDoList = new CompositeOperation(operation.getLabel());
		toDoList.add(operation);
		for (PlanStructureOperationContributor contributor : CONTRIBUTORS) {
			contributor.contributeOperations(toDoList, operation, transferable, location);
		}
		return toDoList;
	}
	return operation;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:PlanStructureOperationContributor.java

示例3: Suggestion

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
/**
 * Create a suggestion.  See getters for parameter descriptions.
 * @param icon
 * @param description
 * @param operation
 */
public Suggestion(ImageDescriptor icon, String description, IUndoableOperation operation) {
	super();
	this.icon = icon;
	this.description = (description != null ? description : operation.getLabel());
	this.operation = operation;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:13,代码来源:Suggestion.java

示例4: inJobInRule

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
/**
 * Undo/redo this operation, returning a status.
 * This method is required to be executed with the appropriate scheduling rule.
 * This method is required to be executed in a Job.
 * 
 * @param info
 * @param monitor
 * @param operation
 * @param undo true if undo, false if redo
 * @return
 */
private IStatus inJobInRule(IAdaptable info, IProgressMonitor monitor, IUndoableOperation operation, boolean undo) {
	try {
		if (undo) {
			return JobOperationHistory.super.doUndo(monitor, info, operation);
		} else {
			return JobOperationHistory.super.doRedo(monitor, info, operation);
		}
	} catch (ExecutionException e) {
		return new ExceptionStatus(CommonPlugin.ID, operation.getLabel(), e);
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:JobOperationHistory.java

示例5: peekUndoName

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public String peekUndoName() {
  IUndoableOperation op =
      fOperationHistory.getUndoOperation(RefactoringCorePlugin.getUndoContext());
  if (op == null) return null;
  return op.getLabel();
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:UndoManager2.java

示例6: peekRedoName

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public String peekRedoName() {
  IUndoableOperation op =
      fOperationHistory.getRedoOperation(RefactoringCorePlugin.getUndoContext());
  if (op == null) return null;
  return op.getLabel();
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:UndoManager2.java

示例7: getDropCommand

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Command getDropCommand(Request request) {
	final PlanTimelineViewer viewer = getCastedViewer();
	IUndoContext undoContext = TransactionUtils.getUndoContext(viewer.getPlan());
	EPlanElement targetPlanElement = getTargetNode();
	DropTargetEvent event = getDropTargetEvent(request); 
	Point dropLocation = getDropLocation(request);
	Date startTime = getDropTime(dropLocation);
	ITransferable transferable = TransferRegistry.getInstance().getDroppedObjects(event.data, event.currentDataType);
	final PlanEditorModel model = viewer.getPlanEditorModel();
	InsertionSemantics semantics = InsertionSemantics.ON;
	if (!EnsembleDragAndDropOracle.isDragSourceEditorModel(model)
		&& ((event.operations & DND.DROP_COPY) != 0)) {
		event.detail = DND.DROP_COPY;
	}
	IStructureModifier modifier = PlanStructureModifier.INSTANCE;
	if (event.detail == DND.DROP_COPY) {
		transferable = modifier.copy(transferable);
	}
	StructuredSelection selection;
	if (targetPlanElement == null) {
		selection = new StructuredSelection();
	} else {
		selection = new StructuredSelection(targetPlanElement); 
	}
	
	IFigure figure = ((GraphicalEditPart)getHost()).getFigure();		
	int y = figure.getBounds().y;
	int height = figure.getBounds().height;
	int lowerBound = y;		
	int upperBound = y + height;
	
	if ((dropLocation.y - lowerBound) < BOUNDARY_MARGIN) {
		semantics = InsertionSemantics.BEFORE;
	} else if ((upperBound - dropLocation.y) < BOUNDARY_MARGIN) {
		semantics = InsertionSemantics.AFTER;
	}
	
	boolean canInsert = false;
	for (TransferData d : getTransfer(request).getSupportedTypes()){
		canInsert = modifier.canInsert(d, selection, InsertionSemantics.ON);
		if (canInsert) break;
	}

	if (!canInsert) {
		semantics = InsertionSemantics.ON;
	}
	if (transferable instanceof IPlanElementTransferable) {
		TemporalTransferableExtension.setTransferableStartTime((IPlanElementTransferable)transferable, startTime);
	}
	IStructureLocation location = modifier.getInsertionLocation(transferable, selection, semantics);
	IUndoableOperation op = new TimelineAddOperation(transferable, modifier, location, viewer.getTimeline());
	op = PlanStructureOperationContributor.addContributorOperations(op, (IPlanElementTransferable)transferable, (PlanStructureLocation)location);
	if (isChangeValueRequest()) {
		ChangeBoundsRequest changeBoundRequest = new ChangeBoundsRequest(TimelineConstants.REQ_CHANGE_VALUE_VIA_DROP);
		if (transferable instanceof IPlanElementTransferable) {
			IPlanElementTransferable planTransferable = (IPlanElementTransferable) transferable;
			changeBoundRequest.setEditParts(planTransferable.getPlanElements());
		}

		changeBoundRequest.setLocation(dropLocation);
		Command command = getHost().getCommand(changeBoundRequest);
		//
		// This is terribly annoying, EMF wrapped in Operation, wrapped in GEF
		if (command instanceof OperationCommand) {
			IUndoableOperation setValueOperation = ((OperationCommand)command).getOperation();
			CompositeOperation compound = new CompositeOperation(op.getLabel());
			compound.add(setValueOperation);
			compound.add(op);
			op = compound;
		}
	}
	IWorkbenchPartSite site = viewer.getSite();
	return new OperationCommand(undoContext, op, event.widget, site);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:77,代码来源:TimelineDropEditPolicy.java

示例8: OperationJob

import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public OperationJob(IUndoableOperation operation) {
	super(operation.getLabel());
	ISchedulingRule rule = getSchedulingRule(operation);
	setRule(rule);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:6,代码来源:OperationJob.java


注:本文中的org.eclipse.core.commands.operations.IUndoableOperation.getLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。