org.eclipse.gef.requests.DirectEditRequest Java Examples

The following examples show how to use org.eclipse.gef.requests.DirectEditRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ColumnSelectionHandlesEditPolicy.java    From erflute with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: NoteDirectEditPolicy.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@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();
}
 
Example #3
Source File: TableViewComponentEditPolicy.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@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);
}
 
Example #4
Source File: TableViewComponentEditPolicy.java    From erflute with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #5
Source File: ColumnSelectionHandlesEditPolicy.java    From erflute with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example #6
Source File: ColumnSelectionHandlesEditPolicy.java    From erflute with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example #7
Source File: ERDiagramLayoutEditPolicy.java    From erflute with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #8
Source File: TableViewComponentEditPolicy.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example #9
Source File: IntermediateErrorCatchEventLabel5EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #10
Source File: StartMessageEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #11
Source File: ServiceTaskLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #12
Source File: IntermediateErrorCatchEventLabel5EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #13
Source File: IntermediateErrorCatchEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #14
Source File: IntermediateCatchSignalEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #15
Source File: ColumnSelectionHandlesEditPolicy.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
private int getColumnIndex(DirectEditRequest editRequest) {
	ZoomManager zoomManager = ((ScalableFreeformRootEditPart) this
			.getHost().getRoot()).getZoomManager();
	double zoom = zoomManager.getZoom();

	ColumnEditPart columnEditPart = (ColumnEditPart) this.getHost();

	Column column = (Column) columnEditPart.getModel();
	TableView newTableView = (TableView) this.getHost().getParent()
			.getModel();

	List<Column> columns = newTableView.getColumns();

	if (column.getColumnHolder() instanceof ColumnGroup) {
		column = (ColumnGroup) column.getColumnHolder();
	}
	int index = columns.indexOf(column);

	Rectangle columnRectangle = this.getColumnRectangle();
	int center = (int) ((columnRectangle.y + (columnRectangle.height / 2)) * zoom);

	if (editRequest.getLocation().y >= center) {
		index++;
	}

	return index;
}
 
Example #16
Source File: TableViewComponentEditPolicy.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@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())) {
		DirectEditRequest editRequest = (DirectEditRequest) request;

		TableView tableView = (TableView) this.getHost().getModel();
		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);
}
 
Example #17
Source File: BoundaryTimerEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #18
Source File: StartEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #19
Source File: BoundaryTimerEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #20
Source File: EndEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #21
Source File: EndEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #22
Source File: IntermediateCatchSignalEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #23
Source File: SendTaskLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #24
Source File: BoundarySignalEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #25
Source File: NonInterruptingBoundaryTimerEventName2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #26
Source File: EndTerminatedEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #27
Source File: StartTimerEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #28
Source File: StartTimerEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}
 
Example #29
Source File: StartTimerEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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();
	}
}
 
Example #30
Source File: IntermediateThrowMessageEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy() {

		@Override
		protected void eraseDirectEditFeedback(DirectEditRequest request) {
			super.eraseDirectEditFeedback(request);
			getRoot().refresh();
		}

	});
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ProcessTextSelectionEditPolicy());
}