本文整理汇总了Java中org.eclipse.gef.EditPartViewer.select方法的典型用法代码示例。如果您正苦于以下问题:Java EditPartViewer.select方法的具体用法?Java EditPartViewer.select怎么用?Java EditPartViewer.select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.EditPartViewer
的用法示例。
在下文中一共展示了EditPartViewer.select方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performSelection
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* Performs the appropriate selection action based on the selection state of
* the source and the modifiers (CTRL and SHIFT). If no modifier key is
* pressed, the source will be set as the only selection. If the CTRL key is
* pressed and the edit part is already selected, it will be deselected. If
* the CTRL key is pressed and the edit part is not selected, it will be
* appended to the selection set. If the SHIFT key is pressed, the source
* will be appended to the selection.
*/
protected void performSelection() {
if (hasSelectionOccurred())
return;
setFlag(FLAG_SELECTION_PERFORMED, true);
EditPartViewer viewer = getCurrentViewer();
List selectedObjects = viewer.getSelectedEditParts();
if (getCurrentInput().isModKeyDown(SWT.MOD1)) {
if (selectedObjects.contains(getSourceEditPart()))
viewer.deselect(getSourceEditPart());
else
viewer.appendSelection(getSourceEditPart());
} else if (getCurrentInput().isShiftKeyDown())
viewer.appendSelection(getSourceEditPart());
else
viewer.select(getSourceEditPart());
}
示例2: handleButtonDown
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected boolean handleButtonDown( int button )
{
if ( this.isInState( STATE_INITIAL ) && button == 1 )
{
//Select the ColumnEditPart
EditPartViewer viewer = this.getCurrentViewer( );
viewer.select( getSourceEditPart( ) );
this.updateTargetRequest( );
this.updateTargetUnderMouse( );
super.handleButtonDown( button );
this.handleDrag( );
return true;
}
return super.handleButtonDown( button );
}
示例3: mouseUp
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* This will show the handle to resize thanks to the super call
*/
@Override
public void mouseUp(MouseEvent me, EditPartViewer viewer) {
boolean wasDragging = movedPastThreshold();
if (me.button == 1 && !wasDragging) {
EditPart clickedPart = viewer.findObjectAt(new Point(me.x, me.y));
viewer.select(clickedPart);
} else
super.mouseUp(me, viewer);
}
示例4: mouseUp
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* When a click is done in a band only that band will be selected and all others elements deselected, when is done out
* of the work area all the elements will be deselected
*/
@Override
public void mouseUp(MouseEvent me, EditPartViewer viewer) {
boolean wasDragging = movedPastThreshold();
if (me.button == 1 && !wasDragging) {
EditPart clickedPart = viewer.findObjectAt(new Point(me.x, me.y));
if (clickedPart instanceof BandEditPart) {
viewer.select(clickedPart);
} else
viewer.deselectAll();
} else
super.mouseUp(me, viewer);
}
示例5: selectAddedObject
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
private void selectAddedObject() {
Object model = getCreateRequest().getNewObject();
if (model == null)
return;
EditPartViewer viewer = getViewer();
viewer.getControl().forceFocus();
Object editpart = viewer.getEditPartRegistry().get(model);
if (editpart instanceof EditPart) {
// Force a layout first.
getViewer().flush();
viewer.select((EditPart) editpart);
}
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:JSSTemplateTransferDropTargetListener.java
示例6: selectAddedObject
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
private void selectAddedObject(EditPartViewer viewer) {
final Object model = getCreateRequest().getNewObject();
if (model == null || viewer == null)
return;
Object editpart = viewer.getEditPartRegistry().get(model);
if (editpart instanceof EditPart) {
// Force the new object to get positioned in the viewer.
viewer.flush();
viewer.select((EditPart) editpart);
}
}
示例7: run
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
public void run( )
{
if ( Policy.TRACING_ACTIONS )
{
System.out.println( "Delete table action >> Run ..." ); //$NON-NLS-1$
}
if ( getTableGroup( ) != null && getTableEditPart( ) != null )
{
TableEditPart part = getTableEditPart( );
EditPartViewer viewer = part.getViewer( );
part.removeGroup( getTableGroup( ) );
viewer.select( part );
}
}
示例8: execute
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
public Object execute( ExecutionEvent event ) throws ExecutionException
{
super.execute( event );
TableEditPart part = getTableEditPart( );
if ( part != null )
{
EditPartViewer viewer = part.getViewer( );
part.deleteRow( getRowNumbers( ) );
viewer.select( part );
}
return Boolean.TRUE;
}
示例9: execute
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
public Object execute( ExecutionEvent event ) throws ExecutionException
{
super.execute( event );
TableEditPart part = getTableEditPart( );
if ( part != null )
{
EditPartViewer viewer = part.getViewer( );
part.deleteColumn( getColumnNumbers( ) );
viewer.select( part );
}
return Boolean.TRUE;
}
示例10: performSelection
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected void performSelection( )
{
EditPartViewer viewer = this.getCurrentViewer( );
viewer.select( getSourceEditPart( ) );
}
示例11: performSelection
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected void performSelection() {
if (hasSelectionOccurred())
return;
EditPart real = null;
List children = getSourceEditPart( ).getChildren( );
for (int i=0; i<children.size( ); i++)
{
if (children.get( i ) instanceof AbstractTableEditPart)
{
real = (EditPart)children.get( i );
break;
}
}
if (real == null)
{
real = getSourceEditPart( );
}
setFlag(FLAG_SELECTION_PERFORMED, true);
EditPartViewer viewer = getCurrentViewer();
List selectedObjects = viewer.getSelectedEditParts();
if (getCurrentInput().isModKeyDown(SWT.MOD1)) {
if (selectedObjects.contains(getSourceEditPart()))
viewer.deselect(getSourceEditPart());
else
{
if (number == 0)
{
viewer.appendSelection(real);
}
else
{
viewer.appendSelection(getSourceEditPart());
}
}
} else if (getCurrentInput().isShiftKeyDown())
{
if (number == 0)
{
viewer.appendSelection(real);
}
else
{
viewer.appendSelection(getSourceEditPart());
}
}
else
{
if (number == 0)
{
viewer.select(real);
}
else
{
viewer.select(getSourceEditPart());
}
}
}
示例12: performSelection
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected void performSelection( )
{
if ( hasSelectionOccurred( ) )
return;
/**
* Hacks the old selection algorithm, checks the consistency of parents
* of selected objects.
*/
if ( getCurrentInput( ).isControlKeyDown( )
|| getCurrentInput( ).isShiftKeyDown( ) )
{
setFlag( FLAG_SELECTION_PERFORMED, true );
EditPartViewer viewer = getCurrentViewer( );
List selectedObjects = viewer.getSelectedEditParts( );
boolean consist = true;
EditPart sourceParent = getSourceEditPart( ).getParent( );
for ( Iterator itr = selectedObjects.iterator( ); itr.hasNext( ); )
{
EditPart part = (EditPart) itr.next( );
if ( part.getParent( ) != sourceParent )
{
consist = false;
break;
}
}
if ( consist )
{
if ( getCurrentInput( ).isControlKeyDown( ) )
{
/**
* Does nothing, leaves it to performCtrlSelect().
*/
return;
}
else if ( getCurrentInput( ).isShiftKeyDown( ) )
{
/**
* Does nothing, leaves it to performShiftSelect().
*/
return;
}
}
viewer.select( getSourceEditPart( ) );
return;
}
super.performSelection( );
}
示例13: execute
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
public Object execute( ExecutionEvent event ) throws ExecutionException
{
super.execute( event );
GroupHandle handle = null;
ReportElementEditPart editPart = null;
IEvaluationContext context = (IEvaluationContext) event.getApplicationContext( );
Object obj =UIUtil.getVariableFromContext( context, ICommandParameterNameContants.DELETE_GROUP_HANDLE );
if ( ( obj == null ) || ( !( obj instanceof GroupHandle ) ) )
{
return Boolean.FALSE;
}
handle = (GroupHandle) obj;
obj = UIUtil.getVariableFromContext( context, ICommandParameterNameContants.DELETE_GROUP_EDIT_PART );
if ( ( obj == null ) || ( !( obj instanceof ReportElementEditPart ) ) )
{
return Boolean.FALSE;
}
editPart = (ReportElementEditPart) obj;
CommandStack stack = getActiveCommandStack( );
stack.startTrans( STACK_MSG_DELETE_GROUP );
if ( handle.canDrop( ) )
{
EditPartViewer viewer = editPart.getViewer( );
try
{
handle.drop( );
stack.commit( );
}
catch ( SemanticException e )
{
stack.rollbackAll( );
ExceptionHandler.handle( e );
}
viewer.select( editPart );
}
return Boolean.TRUE;
}