本文整理汇总了Java中org.eclipse.gef.requests.DirectEditRequest类的典型用法代码示例。如果您正苦于以下问题:Java DirectEditRequest类的具体用法?Java DirectEditRequest怎么用?Java DirectEditRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DirectEditRequest类属于org.eclipse.gef.requests包,在下文中一共展示了DirectEditRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: performCreation
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的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: getTargetEditPart
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public EditPart getTargetEditPart(final Request request) {
if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_COLUMN_GROUP.equals(request.getType()) || ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN_GROUP.equals(request.getType())) {
final DirectEditRequest editRequest = (DirectEditRequest) request;
final TableView tableView = (TableView) getHost().getModel();
final ColumnGroup columnGroup = (ColumnGroup) ((Map) editRequest.getDirectEditFeature()).get("group");
if (!tableView.getColumns().contains(columnGroup)) {
return getHost();
}
} else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_WORD.equals(request.getType())) {
return getHost();
} else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN.equals(request.getType())) {
return getHost();
}
return super.getTargetEditPart(request);
}
开发者ID:roundrop,项目名称:ermasterr,代码行数:26,代码来源:TableViewComponentEditPolicy.java
示例3: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
private int getColumnIndex(final DirectEditRequest editRequest) {
final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
final double zoom = zoomManager.getZoom();
final ColumnEditPart columnEditPart = (ColumnEditPart) getHost();
Column column = (Column) columnEditPart.getModel();
final TableView newTableView = (TableView) getHost().getParent().getModel();
final List<Column> columns = newTableView.getColumns();
if (column.getColumnHolder() instanceof ColumnGroup) {
column = (ColumnGroup) column.getColumnHolder();
}
int index = columns.indexOf(column);
final Rectangle columnRectangle = getColumnRectangle();
final int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);
if (editRequest.getLocation().y >= center) {
index++;
}
return index;
}
开发者ID:roundrop,项目名称:ermasterr,代码行数:26,代码来源:ColumnSelectionHandlesEditPolicy.java
示例4: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command getDirectEditCommand(final DirectEditRequest request) {
final CompoundCommand command = new CompoundCommand();
final String text = (String) request.getCellEditor().getValue();
final Note note = (Note) getHost().getModel();
final NoteEditCommand noteEditCommand = new NoteEditCommand(note, text);
command.add(noteEditCommand);
final MoveElementCommand autoResizeCommand = new MoveElementCommand((ERDiagram) getHost().getRoot().getContents().getModel(), getHostFigure().getBounds(), note.getX(), note.getY(), -1, -1, note);
command.add(autoResizeCommand);
return command.unwrap();
}
开发者ID:roundrop,项目名称:ermasterr,代码行数:19,代码来源:NoteDirectEditPolicy.java
示例5: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
.getHost().getRoot()).getZoomManager();
double zoom = zoomManager.getZoom();
IFigure figure = ((TableViewEditPart) this.getHost()).getFigure();
int center = (int) (figure.getBounds().y + (figure.getBounds().height / 2)
* zoom);
int index = 0;
if (editRequest.getLocation().y >= center) {
TableView newTableView = (TableView) this.getHost().getModel();
index = newTableView.getColumns().size();
}
return index;
}
开发者ID:kozake,项目名称:ermaster-k,代码行数:21,代码来源:TableViewComponentEditPolicy.java
示例6: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
CompoundCommand command = new CompoundCommand();
String text = (String) request.getCellEditor().getValue();
Note note = (Note) getHost().getModel();
NoteEditCommand noteEditCommand = new NoteEditCommand(note, text);
command.add(noteEditCommand);
ERDiagram diagram = (ERDiagram) this.getHost().getRoot().getContents().getModel();
Category currentCategory = diagram.getCurrentCategory();
MoveElementCommand autoResizeCommand = new MoveElementCommand(
diagram,
this.getHostFigure().getBounds(),
note.getX(currentCategory),
note.getY(currentCategory),
-1,
-1,
note);
command.add(autoResizeCommand);
return command.unwrap();
}
开发者ID:kozake,项目名称:ermaster-k,代码行数:29,代码来源:NoteDirectEditPolicy.java
示例7: getTargetEditPart
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
public EditPart getTargetEditPart(Request request) {
if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_COLUMN_GROUP.equals(request.getType())
|| ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN_GROUP.equals(request.getType())) {
final DirectEditRequest editRequest = (DirectEditRequest) request;
final TableView tableView = (TableView) getHost().getModel();
final ColumnGroup columnGroup = (ColumnGroup) ((Map<?, ?>) editRequest.getDirectEditFeature()).get("group");
if (!tableView.getColumns().contains(columnGroup)) {
return getHost();
}
} else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_WORD.equals(request.getType())) {
return getHost();
} else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN.equals(request.getType())) {
return getHost();
}
return super.getTargetEditPart(request);
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:19,代码来源:TableViewComponentEditPolicy.java
示例8: getTargetEditPart
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
public EditPart getTargetEditPart(Request request) {
if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_COLUMN_GROUP.equals(request.getType())
|| ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN_GROUP.equals(request.getType())) {
final DirectEditRequest editRequest = (DirectEditRequest) request;
final TableView tableView = (TableView) getHost().getParent().getModel();
final ColumnGroup columnGroup =
(ColumnGroup) ((Map<?, ?>) editRequest.getDirectEditFeature())
.get(ERDiagramTransferDragSourceListener.MOVE_COLUMN_GROUP_PARAM_GROUP);
final Object parent =
((Map<?, ?>) editRequest.getDirectEditFeature())
.get(ERDiagramTransferDragSourceListener.MOVE_COLUMN_GROUP_PARAM_PARENT);
if (parent == tableView || !tableView.getColumns().contains(columnGroup)) {
return getHost();
}
} else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_ADD_WORD.equals(request.getType())) {
return getHost();
} else if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_MOVE_COLUMN.equals(request.getType())) {
return getHost();
}
return super.getTargetEditPart(request);
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:23,代码来源:ColumnSelectionHandlesEditPolicy.java
示例9: createMoveColumnGroupCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
public static Command createMoveColumnGroupCommand(DirectEditRequest editRequest, TableView newTableView, int index) {
final ColumnGroup columnGroup =
(ColumnGroup) ((Map<?, ?>) editRequest.getDirectEditFeature())
.get(ERDiagramTransferDragSourceListener.MOVE_COLUMN_GROUP_PARAM_GROUP);
final TableView oldTableView =
(TableView) ((Map<?, ?>) editRequest.getDirectEditFeature())
.get(ERDiagramTransferDragSourceListener.MOVE_COLUMN_GROUP_PARAM_PARENT);
if (newTableView == oldTableView) {
return new ChangeColumnOrderCommand(newTableView, columnGroup, index);
}
final CompoundCommand command = new CompoundCommand();
final TableView copyOldTableView = oldTableView.copyData();
for (final ERColumn column : copyOldTableView.getColumns()) {
if (column == columnGroup) {
copyOldTableView.removeColumn(column);
break;
}
}
final ChangeTableViewPropertyCommand sourceTableCommand = new ChangeTableViewPropertyCommand(oldTableView, copyOldTableView);
command.add(sourceTableCommand);
if (!newTableView.getColumns().contains(columnGroup)) {
command.add(new AddColumnGroupCommand(newTableView, columnGroup, index));
}
return command.unwrap();
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:26,代码来源:ColumnSelectionHandlesEditPolicy.java
示例10: getColumnIndex
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
private int getColumnIndex(DirectEditRequest editRequest) {
final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
final double zoom = zoomManager.getZoom();
final ColumnEditPart columnEditPart = (ColumnEditPart) getHost();
ERColumn column = (ERColumn) columnEditPart.getModel();
final TableView newTableView = (TableView) getHost().getParent().getModel();
final List<ERColumn> columns = newTableView.getColumns();
if (column.getColumnHolder() instanceof ColumnGroup) {
column = (ColumnGroup) column.getColumnHolder();
}
int index = columns.indexOf(column);
final Rectangle columnRectangle = getColumnRectangle();
final int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);
if (editRequest.getLocation().y >= center) {
index++;
}
return index;
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:19,代码来源:ColumnSelectionHandlesEditPolicy.java
示例11: getCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
public Command getCommand(Request request) {
if (ERDiagramTransferDragSourceListener.REQUEST_TYPE_PLACE_TABLE.equals(request.getType())) {
final DirectEditRequest editRequest = (DirectEditRequest) request;
final Object feature = editRequest.getDirectEditFeature();
if (feature instanceof ERTable) {
final ERTable ertable = (ERTable) feature;
return new PlaceTableCommand(ertable);
}
if (feature instanceof List) {
@SuppressWarnings("unchecked")
final List<ERTable> list = (List<ERTable>) feature;
return new PlaceTableCommand(list);
}
}
return super.getCommand(request);
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:18,代码来源:ERDiagramLayoutEditPolicy.java
示例12: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
CompoundCommand command = new CompoundCommand();
String text = (String) request.getCellEditor().getValue();
Note note = (Note) getHost().getModel();
NoteEditCommand noteEditCommand = new NoteEditCommand(note, text);
command.add(noteEditCommand);
MoveElementCommand autoResizeCommand = new MoveElementCommand(
(ERDiagram) this.getHost().getRoot().getContents().getModel(), this
.getHostFigure().getBounds(), note.getX(), note.getY(),
-1, -1, note);
command.add(autoResizeCommand);
return command.unwrap();
}
开发者ID:justinkwony,项目名称:ermaster-nhit,代码行数:22,代码来源:NoteDirectEditPolicy.java
示例13: createDirectEditPolicy
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
protected EditableElementDirectEditPolicy createDirectEditPolicy()
{
return new EditableElementDirectEditPolicy() {
@Override
protected String getDirectEditValue(DirectEditRequest edit)
{
String text = super.getDirectEditValue(edit);
if(getInstallOptionsEditableElement().getTypeDef().getFlags().contains(InstallOptionsModel.FLAGS_MULTILINE) &&
getInstallOptionsEditableElement().getFlags().contains(InstallOptionsModel.FLAGS_MULTILINE)) {
text = TypeConverter.ESCAPED_STRING_CONVERTER.asType(text);
}
return text;
}
};
}
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:17,代码来源:InstallOptionsTextEditPart.java
示例14: performCreation
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* After the creation of a {@link NamedElement} through a pallet entry this method is called. This method
* send a {@link DirectEditRequest} to the edit part of the just created {@link NamedElement}. Through the
* request can the user edit the name of the NamedElement direct after the creation of the NamedElement.
*
* */
@Override
protected void performCreation(final int button) {
super.performCreation(button);
final 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() {
final EditPart part = (EditPart) o;
final Request request = new DirectEditRequest();
part.performRequest(request);
}
});
}
}
开发者ID:leondart,项目名称:FRaMED,代码行数:30,代码来源:CreationAndDirectEditTool.java
示例15: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
CompoundCommand command = new CompoundCommand();
String text = (String) request.getCellEditor().getValue();
NoteModel note = (NoteModel) getHost().getModel();
NoteEditCommand noteEditCommand = new NoteEditCommand(note, text);
command.add(noteEditCommand);
Rectangle rectangle=new Rectangle(note.getX(),note.getY(),-1,-1);
MoveElementCommand scommand = new MoveElementCommand();
scommand.setElement(note);
scommand.setRectangle(rectangle);
command.add(scommand);
return command.unwrap();
}
开发者ID:winture,项目名称:wt-studio,代码行数:20,代码来源:NoteDirectEditPolicy.java
示例16: performDirectEditRequest
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
/**
* @generated
*/
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
try {
getEditingDomain().runExclusive(new Runnable() {
public void run() {
if (isActive() && isEditable()) {
if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) theRequest.getExtendedData().get(
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
}
}
}
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:28,代码来源:ParentRequirementLabelEditPart.java
示例17: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
String value = (String) request.getCellEditor().getValue();
if(Constant.START_VERTEX_NAME.equalsIgnoreCase(value.trim())) {
return UnexecutableCommand.INSTANCE;
}
GraphElementRenameCommand command = new GraphElementRenameCommand();
command.setOldName(((Vertex) getHost().getModel()).getName());
command.setModel((Vertex) getHost().getModel());
command.setNewName(value);
return command;
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GW4EVertexDirectEditPolicy.java
示例18: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
String value = (String) request.getCellEditor().getValue();
GraphElementRenameCommand command = new GraphElementRenameCommand();
GraphElement model = (GraphElement) getHost().getModel();
command.setModel(model);
command.setOldName(model.getName());
command.setNewName(value);
return command;
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:11,代码来源:GW4EEdgeDirectEditPolicy.java
示例19: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
DwFeatureEditPart editPart = (DwFeatureEditPart)getHost();
DwFeatureRenameCommand command = new DwFeatureRenameCommand((DwFeatureWrapped)editPart.getModel(), (DwGraphicalFeatureModelEditor)editPart.getEditor());
command.setNewName((String)request.getCellEditor().getValue());
return command;
}
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:9,代码来源:DwFeatureDirectEditPolicy.java
示例20: getDirectEditCommand
import org.eclipse.gef.requests.DirectEditRequest; //导入依赖的package包/类
@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
DwAttributeEditPart editPart = (DwAttributeEditPart)getHost();
DwAttributeRenameCommand command = new DwAttributeRenameCommand((HyFeatureAttribute)editPart.getModel(), (DwGraphicalFeatureModelEditor)editPart.getEditor());
command.setNewName((String)request.getCellEditor().getValue());
return command;
}
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:9,代码来源:DwAttributeDirectEditPolicy.java
注:本文中的org.eclipse.gef.requests.DirectEditRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论