当前位置: 首页>>代码示例>>Java>>正文


Java EditPartViewer.select方法代码示例

本文整理汇总了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());
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:27,代码来源:SelectEditPartTracker.java

示例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 );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:ConnectionCreation.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:SubEditorEditPartTracker.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:NotMovablePartDragTracker.java

示例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);
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:12,代码来源:CreationTool.java

示例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 );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:DeleteTableGroupAction.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:DeleteRowHandler.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:14,代码来源:DeleteColumnHandler.java

示例10: performSelection

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected void performSelection( )
{
	EditPartViewer viewer = this.getCurrentViewer( );
	viewer.select( getSourceEditPart( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:6,代码来源:ConnectionCreation.java

示例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());
		}
	}
		
}
 
开发者ID:eclipse,项目名称:birt,代码行数:60,代码来源:MultipleGuideHandle.java

示例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( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:57,代码来源:CellDragTracker.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:45,代码来源:DeleteGrouphandler.java


注:本文中的org.eclipse.gef.EditPartViewer.select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。