本文整理汇总了Java中org.eclipse.gef.GraphicalViewer.getSelectedEditParts方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalViewer.getSelectedEditParts方法的具体用法?Java GraphicalViewer.getSelectedEditParts怎么用?Java GraphicalViewer.getSelectedEditParts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.GraphicalViewer
的用法示例。
在下文中一共展示了GraphicalViewer.getSelectedEditParts方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
final GraphicalViewer viewer = getGraphicalViewer();
for (final Object object : viewer.getSelectedEditParts()) {
if (object instanceof ConnectionEditPart) {
return true;
} else if (object instanceof NodeElementEditPart) {
final NodeElementEditPart nodeElementEditPart = (NodeElementEditPart) object;
if (!nodeElementEditPart.getSourceConnections().isEmpty()) {
return true;
}
}
}
return false;
}
示例2: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected boolean calculateEnabled() {
final GraphicalViewer viewer = getGraphicalViewer();
for (final Object object : viewer.getSelectedEditParts()) {
if (object instanceof ConnectionEditPart) {
return true;
} else if (object instanceof NodeElementEditPart) {
final NodeElementEditPart nodeElementEditPart = (NodeElementEditPart) object;
if (!nodeElementEditPart.getSourceConnections().isEmpty()) {
return true;
}
}
}
return false;
}
示例3: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected boolean calculateEnabled() {
final GraphicalViewer viewer = getGraphicalViewer();
for (final Object object : viewer.getSelectedEditParts()) {
if (object instanceof NodeElementEditPart) {
final NodeElementEditPart nodeElementEditPart = (NodeElementEditPart) object;
if (nodeElementEditPart instanceof ERTableEditPart || nodeElementEditPart instanceof NoteEditPart) {
return true;
}
}
}
return false;
}
示例4: execute
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
protected void execute(final Event event) {
final GraphicalViewer viewer = getGraphicalViewer();
final List<Command> commandList = new ArrayList<Command>();
for (final Object object : viewer.getSelectedEditParts()) {
final List<Command> subCommandList = getCommand((EditPart) object, event);
commandList.addAll(subCommandList);
}
if (!commandList.isEmpty()) {
final CompoundCommand compoundCommand = new CompoundCommand();
for (final Command command : commandList) {
compoundCommand.add(command);
}
this.execute(compoundCommand);
}
}
示例5: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
GraphicalViewer viewer = this.getGraphicalViewer();
for (Object object : viewer.getSelectedEditParts()) {
if (object instanceof ConnectionEditPart) {
return true;
} else if (object instanceof NodeElementEditPart) {
NodeElementEditPart nodeElementEditPart = (NodeElementEditPart) object;
if (!nodeElementEditPart.getSourceConnections().isEmpty()) {
return true;
}
}
}
return false;
}
示例6: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected boolean calculateEnabled() {
GraphicalViewer viewer = this.getGraphicalViewer();
for (Object object : viewer.getSelectedEditParts()) {
if (object instanceof ConnectionEditPart) {
return true;
} else if (object instanceof NodeElementEditPart) {
NodeElementEditPart nodeElementEditPart = (NodeElementEditPart) object;
if (!nodeElementEditPart.getSourceConnections().isEmpty()) {
return true;
}
}
}
return false;
}
示例7: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected boolean calculateEnabled() {
GraphicalViewer viewer = this.getGraphicalViewer();
for (Object object : viewer.getSelectedEditParts()) {
if (object instanceof NodeElementEditPart) {
NodeElementEditPart nodeElementEditPart = (NodeElementEditPart) object;
if (nodeElementEditPart instanceof ERTableEditPart
|| nodeElementEditPart instanceof NoteEditPart) {
return true;
}
}
}
return false;
}
示例8: execute
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
protected void execute(Event event) {
GraphicalViewer viewer = this.getGraphicalViewer();
List<Command> commandList = new ArrayList<Command>();
for (Object object : viewer.getSelectedEditParts()) {
List<Command> subCommandList = this.getCommand((EditPart) object,
event);
commandList.addAll(subCommandList);
}
if (!commandList.isEmpty()) {
CompoundCommand compoundCommand = new CompoundCommand();
for (Command command : commandList) {
compoundCommand.add(command);
}
this.execute(compoundCommand);
}
}
示例9: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
final GraphicalViewer viewer = getGraphicalViewer();
for (final Object object : viewer.getSelectedEditParts()) {
if (object instanceof ConnectionEditPart) {
return true;
} else if (object instanceof DiagramWalkerEditPart) {
final DiagramWalkerEditPart nodeElementEditPart = (DiagramWalkerEditPart) object;
if (!nodeElementEditPart.getSourceConnections().isEmpty()) {
return true;
}
}
}
return false;
}
示例10: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
final GraphicalViewer viewer = getGraphicalViewer();
for (final Object object : viewer.getSelectedEditParts()) {
if (object instanceof DiagramWalkerEditPart) {
final DiagramWalkerEditPart nodeElementEditPart = (DiagramWalkerEditPart) object;
if (nodeElementEditPart instanceof ERTableEditPart || nodeElementEditPart instanceof WalkerNoteEditPart) {
return true;
}
}
}
return false;
}
示例11: execute
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
protected void execute(Event event) {
final GraphicalViewer viewer = getGraphicalViewer();
final List<Command> commandList = new ArrayList<>();
for (final Object object : viewer.getSelectedEditParts()) {
final List<Command> subCommandList = getCommand((EditPart) object, event);
commandList.addAll(subCommandList);
}
if (!commandList.isEmpty()) {
final CompoundCommand compoundCommand = new CompoundCommand();
for (final Command command : commandList) {
compoundCommand.add(command);
}
execute(compoundCommand);
}
}
示例12: calculateEnabled
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected boolean calculateEnabled() {
final GraphicalViewer viewer = getGraphicalViewer();
for (final Object object : viewer.getSelectedEditParts()) {
if (object instanceof ConnectionEditPart) {
return true;
} else if (object instanceof DiagramWalkerEditPart) {
final DiagramWalkerEditPart nodeElementEditPart = (DiagramWalkerEditPart) object;
if (!nodeElementEditPart.getSourceConnections().isEmpty()) {
return true;
}
}
}
return false;
}