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


Java Request类代码示例

本文整理汇总了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);
			}
		});
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:CreationAndDirectEditTool.java

示例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);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:ComponentEditPart.java

示例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;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:17,代码来源:ColumnOrderedLayoutEditPolicy.java

示例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();
		}
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:29,代码来源:DwFeatureEditorEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:20,代码来源:WordOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:26,代码来源:TablespaceOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:23,代码来源:ViewOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:25,代码来源:GroupOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:24,代码来源:GroupSetOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:21,代码来源:IndexOutlineEditPart.java

示例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);
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:25,代码来源:SequenceOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:23,代码来源:TableOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:21,代码来源:RelationOutlineEditPart.java

示例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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:20,代码来源:TriggerOutlineEditPart.java

示例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);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:19,代码来源:TableViewGraphicalNodeEditPolicy.java


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