本文整理汇总了Java中org.eclipse.gef.requests.CreateRequest.setFactory方法的典型用法代码示例。如果您正苦于以下问题:Java CreateRequest.setFactory方法的具体用法?Java CreateRequest.setFactory怎么用?Java CreateRequest.setFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.CreateRequest
的用法示例。
在下文中一共展示了CreateRequest.setFactory方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setGenericComponent
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
/**
*
* set genericComponent to selected/hovered component in palette
*
* @param paletteInternalController
* @return
*/
private CreateRequest setGenericComponent(EditPart paletteInternalController) {
CombinedTemplateCreationEntry addedPaletteTool = (CombinedTemplateCreationEntry) paletteInternalController
.getModel();
CreateRequest componentRequest = new CreateRequest();
componentRequest.setFactory(new SimpleFactory((Class) addedPaletteTool
.getTemplate()));
genericComponent = (Component) componentRequest
.getNewObject();
logger.debug("genericComponent - " + genericComponent.toString());
return componentRequest;
}
示例2: createCommand
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
public Command createCommand(List<?> objects) {
if (objects.isEmpty())
return null;
if (!(objects.get(0) instanceof EditPart))
return null;
CreateRequest createReq = new CreateRequest(RequestConstants.REQ_CREATE);
createReq.setLocation(location);
createReq.setFactory(creationFactory);
Map<Object, Object> map = new HashMap<Object, Object>();
if (!setExtendedData(map, objects))
return null;
createReq.setExtendedData(map);
JSSCompoundCommand jssCcmd = new JSSCompoundCommand(null);
for (int i = 0; i < objects.size(); i++) {
Object obj = objects.get(i);
if (obj instanceof EditPart) {
EditPart object = (EditPart) obj;
//Set the node if necessary to disable the refresh
jssCcmd.setReferenceNodeIfNull(object.getModel());
Command cmd = object.getCommand(createReq);
if (cmd != null) {
jssCcmd.add(cmd);
}
}
}
if(!jssCcmd.isEmpty()) {
//Append the command to refresh the column names
ANode tableNode = getTableNode(objects);
jssCcmd.addFirst(new RefreshColumnNamesCommand(tableNode, false, true));
jssCcmd.add(new RefreshColumnNamesCommand(tableNode, true, false));
return jssCcmd;
}
else {
return null;
}
}
示例3: createCommand
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
/**
* Create a command to create the selected objects.
*
* @param objects
* The objects to be deleted.
* @return The command to remove the selected objects.
*/
@Override
public Command createCommand() {
List<Object> objects = getSelectedObjects();
if (objects.isEmpty())
return null;
if (!(objects.get(0) instanceof EditPart))
return null;
CreateRequest createReq = new CreateRequest(RequestConstants.REQ_CREATE);
createReq.setLocation(location);
createReq.setFactory(creationFactory);
Map<Object, Object> map = new HashMap<Object, Object>();
if (!setExtendedData(map, objects))
return null;
createReq.setExtendedData(map);
JSSCompoundCommand jssCcmd = new JSSCompoundCommand(null);
for (int i = 0; i < objects.size(); i++) {
Object obj = objects.get(i);
if (obj instanceof EditPart) {
EditPart object = (EditPart) obj;
//Set the node if necessary to disable the refresh
jssCcmd.setReferenceNodeIfNull(object.getModel());
Command cmd = object.getCommand(createReq);
if (cmd != null) {
jssCcmd.add(cmd);
}
}
}
if(!jssCcmd.isEmpty()) {
return jssCcmd;
}
else {
return null;
}
}
示例4: createTargetRequest
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest()
*/
protected Request createTargetRequest() {
// Look at the data on templatetransfer.
// Create factory
CreateRequest request = new CreateRequest();
request.setFactory(getFactory(TemplateTransfer.getInstance()
.getTemplate()));
return request;
}
示例5: run
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
/**
* This method creates and send the creation request for a attribute, when the user selected a
* attribute, or a operation, when the user selected a operation, to the editpart to which the
* attribute or operation should be added. The editpart to which the attribute or operation is
* added is the parenteditpart of the selected attribute or opeartion.
*
* */
@Override
public void run() {
// get the editorpart to get the selection manager and with the selection manager you can
// deselect the selected element after the creation of the attribute or the method
ORMGraphicalEditor editorPart =
(ORMGraphicalEditor) ((DefaultEditDomain) editPart.getViewer().getEditDomain())
.getEditorPart();
CreateRequest request = new CreateRequest();
// decide and setup the creation request for attribute or opeartion
Segment segment = (Segment) editPart.getModel();
Shape shape = (Shape) editPart.getParent().getModel();
if (shape.getFirstSegment().equals(segment)) {
request.setFactory(new ORMAttributeFactory());
}
if (shape.getSecondSegment().equals(segment)) {
request.setFactory(new ORMOperationFactory());
}
// send the creation request to the editpart
execute(editPart.getCommand(request));
// get the editpart of the newly created attribute or method for starting the initial edit of
// the name of the element
final Object o = editorPart.getOwnViewer().getEditPartRegistry().get(request.getNewObject());
if (o instanceof EditPart) {
EditPart part = (EditPart) o;
Request directrequest = new DirectEditRequest();
// start initial edit of the name of the attribute or the method
part.performRequest(directrequest);
};
// deselect the selected element for case that the user forget to deselect the element
// when not deselected the shortcut behaviour and the contextmenu behaviour can confuse the user
editorPart.getOwnViewer().getSelectionManager().deselectAll();
}
示例6: createTargetRequest
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
@Override
protected Request createTargetRequest()
{
CreateRequest request = new CreateRequest();
request.setFactory(factory);
return request;
}
示例7: createTargetRequest
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
protected Request createTargetRequest() {
CreateRequest request = new CreateRequest();
request.setFactory(factory);
return request;
}
示例8: createTargetRequest
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
@Override
protected Request createTargetRequest() {
CreateRequest request = new CreateRequest();
request.setFactory(factory);
return request;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:7,代码来源:ImageResourceDropTargetListener.java
示例9: createTargetRequest
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.tools.TargetingTool#createTargetRequest()
*/
protected Request createTargetRequest() {
CreateRequest req = new CreateConnectionRequest();
req.setFactory(getFactory());
return req;
}
示例10: createTargetRequest
import org.eclipse.gef.requests.CreateRequest; //导入方法依赖的package包/类
/**
* Creates a {@link CreateRequest} and sets this tool's factory on the
* request.
*
* @see org.eclipse.gef.tools.TargetingTool#createTargetRequest()
*/
protected Request createTargetRequest() {
CreateRequest request = new CreateRequest();
request.setFactory(getFactory());
return request;
}