本文整理汇总了Java中org.eclipse.gef.Request类的典型用法代码示例。如果您正苦于以下问题:Java Request类的具体用法?Java Request怎么用?Java Request使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Request类属于org.eclipse.gef包,在下文中一共展示了Request类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performCreation
import org.eclipse.gef.Request; //导入依赖的package包/类
@Override protected void performCreation(int button) {
super.performCreation(button);
EditPartViewer viewer = getCurrentViewer();
final Object model = getCreateRequest().getNewObject();
if (model == null || viewer == null) {
return;
}
final Object o = getCurrentViewer().getEditPartRegistry().get(model);
if(o instanceof EditPart) {
Display.getCurrent().asyncExec(new Runnable() {
@Override public void run() {
EditPart part = (EditPart)o;
Request request = new DirectEditRequest();
part.performRequest(request);
}
});
}
}
示例2: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
@Override
public void performRequest(Request req) {
// Opens Property Window only on Double click.
if (req.getType().equals(RequestConstants.REQ_OPEN)) {
ComponentFigure componentFigure=this.getComponentFigure();
componentFigure.terminateToolTipTimer();
ELTPropertyWindow propertyWindow = new ELTPropertyWindow(getModel());
propertyWindow.open();
if(Constants.SUBJOB_COMPONENT.equalsIgnoreCase(getCastedModel().getComponentName())){
SubJobUtility subJobUtility=new SubJobUtility();
subJobUtility.updateSubjobPropertyAndGetSubjobContainer(this,null,null,true);
}
if(propertyWindow.isPropertyChanged()){
updateSubjobVersion();
}
updateComponentView(propertyWindow);
super.performRequest(req);
}
}
示例3: getInsertionReference
import org.eclipse.gef.Request; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected EditPart getInsertionReference(Request request) {
int y = ((ChangeBoundsRequest) request).getLocation().y;
List<ColumnEditPart> columnEditParts = getHost().getChildren();
ColumnEditPart afterColumn = null;
for (Iterator<ColumnEditPart> iter = columnEditParts.iterator(); iter.hasNext();) {
ColumnEditPart columnEditPart = iter.next();
Rectangle r = columnEditPart.getFigure().getBounds();
if (y < r.y) {
return afterColumn;
}
afterColumn = columnEditPart;
}
return afterColumn;
}
示例4: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* This method is used to enable direct name editing in the feature
*/
@Override public void performRequest(Request req) {
if(!editor.isLastDateSelected())
return;
if(req.getType() == RequestConstants.REQ_DIRECT_EDIT) {
}
if(req.getType() == RequestConstants.REQ_OPEN){
DwFeatureWrapped feature = (DwFeatureWrapped)getModel();
Date date = editor.getCurrentSelectedDate();
if(feature.calculateVariationTypeCircleBounds(date).contains(((SelectionRequest)req).getLocation())){
HyFeatureType type = HyEvolutionUtil.getValidTemporalElement(feature.getWrappedModelElement().getTypes(), date);
HyFeatureTypeEnum newType = type.getType() == HyFeatureTypeEnum.MANDATORY ? HyFeatureTypeEnum.OPTIONAL : HyFeatureTypeEnum.MANDATORY;
DwFeatureChangeTypeCommand command = new DwFeatureChangeTypeCommand(feature.getWrappedModelElement(), newType, editor);
editor.executeCommand(command);
this.refreshVisuals();
}else{
performDirectEditing();
}
}
}
示例5: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final Word word = (Word) getModel();
final ERDiagram diagram = getDiagram();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final WordDialog dialog = new WordDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), word, false, diagram);
if (dialog.open() == IDialogConstants.OK_ID) {
final EditWordCommand command = new EditWordCommand(word, dialog.getWord(), diagram);
execute(command);
}
}
super.performRequest(request);
}
示例6: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final Tablespace tablespace = (Tablespace) getModel();
final ERDiagram diagram = getDiagram();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final TablespaceDialog dialog = EclipseDBManagerFactory.getEclipseDBManager(diagram).createTablespaceDialog();
if (dialog == null) {
ERDiagramActivator.showMessageDialog("dialog.message.tablespace.not.supported");
} else {
dialog.init(tablespace, diagram);
if (dialog.open() == IDialogConstants.OK_ID) {
final EditTablespaceCommand command = new EditTablespaceCommand(diagram, tablespace, dialog.getResult());
execute(command);
}
}
}
super.performRequest(request);
}
示例7: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final View view = (View) getModel();
final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final View copyView = view.copyData();
final ViewDialog dialog = new ViewDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getViewer(), copyView);
if (dialog.open() == IDialogConstants.OK_ID) {
final CompoundCommand command = ViewEditPart.createChangeViewPropertyCommand(diagram, view, copyView);
execute(command.unwrap());
}
}
super.performRequest(request);
}
示例8: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final ColumnGroup columnGroup = (ColumnGroup) getModel();
final ERDiagram diagram = getDiagram();
final GroupSet groupSet = diagram.getDiagramContents().getGroups();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final GroupDialog dialog = new GroupDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), groupSet, diagram, groupSet.indexOf(columnGroup));
if (dialog.open() == IDialogConstants.OK_ID) {
final List<CopyGroup> newColumnGroups = dialog.getCopyColumnGroups();
final Command command = new ChangeGroupCommand(diagram, groupSet, newColumnGroups);
execute(command);
}
}
super.performRequest(request);
}
示例9: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final ERDiagram diagram = getDiagram();
final GroupSet groupSet = diagram.getDiagramContents().getGroups();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final GroupManageDialog dialog = new GroupManageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), groupSet, diagram, false, -1);
if (dialog.open() == IDialogConstants.OK_ID) {
final List<CopyGroup> newColumnGroups = dialog.getCopyColumnGroups();
final Command command = new ChangeGroupCommand(diagram, groupSet, newColumnGroups);
execute(command);
}
}
super.performRequest(request);
}
示例10: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final Index index = (Index) getModel();
final ERDiagram diagram = getDiagram();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final IndexDialog dialog = new IndexDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), index, index.getTable());
if (dialog.open() == IDialogConstants.OK_ID) {
final ChangeIndexCommand command = new ChangeIndexCommand(diagram, index, dialog.getResultIndex());
execute(command);
}
}
super.performRequest(request);
}
示例11: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
try {
final Sequence sequence = (Sequence) getModel();
final ERDiagram diagram = getDiagram();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final SequenceDialog dialog = new SequenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), sequence, diagram);
if (dialog.open() == IDialogConstants.OK_ID) {
final EditSequenceCommand command = new EditSequenceCommand(diagram, sequence, dialog.getResult());
execute(command);
}
}
super.performRequest(request);
} catch (final Exception e) {
ERDiagramActivator.showExceptionDialog(e);
}
}
示例12: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final ERTable table = (ERTable) getModel();
final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final ERTable copyTable = table.copyData();
final TableDialog dialog = new TableDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getViewer(), copyTable);
if (dialog.open() == IDialogConstants.OK_ID) {
final CompoundCommand command = ERTableEditPart.createChangeTablePropertyCommand(diagram, table, copyTable);
execute(command.unwrap());
}
}
super.performRequest(request);
}
示例13: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final Relation relation = (Relation) getModel();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final Relation copy = relation.copy();
final RelationDialog dialog = new RelationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), copy);
if (dialog.open() == IDialogConstants.OK_ID) {
final ChangeRelationPropertyCommand command = new ChangeRelationPropertyCommand(relation, copy);
execute(command);
}
}
super.performRequest(request);
}
示例14: performRequest
import org.eclipse.gef.Request; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performRequest(final Request request) {
final Trigger trigger = (Trigger) getModel();
final ERDiagram diagram = (ERDiagram) getRoot().getContents().getModel();
if (request.getType().equals(RequestConstants.REQ_OPEN)) {
final TriggerDialog dialog = new TriggerDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), trigger);
if (dialog.open() == IDialogConstants.OK_ID) {
final EditTriggerCommand command = new EditTriggerCommand(diagram, trigger, dialog.getResult());
getViewer().getEditDomain().getCommandStack().execute(command);
}
}
super.performRequest(request);
}
示例15: eraseTargetFeedback
import org.eclipse.gef.Request; //导入依赖的package包/类
@Override
public void eraseTargetFeedback(Request request) {
LayerManager manager = (LayerManager) this.getHost().getRoot();
IFigure layer = manager.getLayer(LayerConstants.PRIMARY_LAYER);
this.getFeedbackLayer().setBounds(layer.getBounds());
List list = this.getFeedbackLayer().getChildren();
for (Iterator iter = list.iterator(); iter.hasNext();) {
Object obj = iter.next();
if (obj instanceof Label) {
iter.remove();
}
}
this.getFeedbackLayer().repaint();
super.eraseTargetFeedback(request);
}