本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}
示例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();
}
示例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);
}
示例8: OperationJob
import org.eclipse.core.commands.operations.IUndoableOperation; //导入方法依赖的package包/类
public OperationJob(IUndoableOperation operation) {
super(operation.getLabel());
ISchedulingRule rule = getSchedulingRule(operation);
setRule(rule);
}