本文整理汇总了Java中org.eclipse.gef.EditPartViewer.getControl方法的典型用法代码示例。如果您正苦于以下问题:Java EditPartViewer.getControl方法的具体用法?Java EditPartViewer.getControl怎么用?Java EditPartViewer.getControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.EditPartViewer
的用法示例。
在下文中一共展示了EditPartViewer.getControl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: display
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* Cause the tooltip shell to activate for the provided host.
* Intentionally does not retain the host, to assist in garbage collection.
*
* @param host
* @param location
*/
public void display(GraphicalEditPart host, Point location) {
if (Tooltip.NONE != getTooltipMode() && windowActive) {
EditPartViewer viewer = GEFUtils.getViewerSafely(host);
if (viewer != null) {
Control control = viewer.getControl();
if (!control.isDisposed()) {
if (host.getFigure() != figure) {
activateTooltip(host, control, location);
}
}
}
}
}
示例2: getDisplay
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* Get the active display thread for the given edit part.
* @param editPart
* @return the active display thread for the given edit part.
*/
private static Display getDisplay(EditPart editPart) {
Display display = null;
if(editPart != null) {
EditPartViewer editPartViewer = editPart.getViewer();
if(editPartViewer != null) {
Control control = editPartViewer.getControl();
if(control != null) {
display = control.getDisplay();
}
}
}
return display;
}
示例3: reactivate
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
* Calls <code>deactivate()</code> and then <code>activate()</code>.
*/
protected void reactivate() {
// Fix for Bug# 91448
EditPartViewer viewer = getCurrentViewer();
deactivate();
activate();
if (viewer != null) {
Control c = viewer.getControl();
if (c != null && !c.isDisposed() && c.isFocusControl())
setViewer(viewer);
}
}
示例4: doubleClick
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
private void doubleClick(final Tool theTool, final EditPartViewer theEditPartViewer) {
final Event theEvent = new Event();
theEvent.widget = theEditPartViewer.getControl();
final MouseEvent mouseEvent = new MouseEvent(theEvent);
mouseEvent.button = 1;
theTool.mouseDoubleClick(mouseEvent, theEditPartViewer);
}
示例5: getReportBounds
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
protected Result getReportBounds( Rectangle reportSize )
{
Result revValue = new Result( );
revValue.reportSize.y = MINTOPSPACE;
revValue.reportSize.width = reportSize.width;
revValue.reportSize.height = reportSize.height;
EditPartViewer viewer = owner.getViewer( );
Scrollable control = viewer == null ? null : (Scrollable)viewer.getControl( );
Rectangle containerSize = control == null ? new Rectangle( )
: new Rectangle( control.getClientArea( ) );
PrecisionDimension dim = new PrecisionDimension( containerSize.width,
containerSize.height );
double scale = getZoomManager( ).getZoom( );
dim.performScale( 1 / scale );
if ( dim.width > reportSize.width + MINLEFTSPACE + MINRIGHTSPACE )
{
revValue.reportSize.x = ( dim.width - reportSize.width ) / 2;
revValue.rightSpace = ( dim.width - reportSize.width ) / 2;
}
else
{
revValue.reportSize.x = MINLEFTSPACE;
revValue.rightSpace = MINRIGHTSPACE;
}
if ( dim.height > reportSize.height + MINTOPSPACE + MINBOTTOMSPACE )
{
revValue.bottomSpace = dim.height - reportSize.height
- revValue.reportSize.y;
}
else
{
revValue.bottomSpace = MINBOTTOMSPACE;
}
return revValue;
}
示例6: run
import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
public void run( )
{
if (!getSourceEditPart( ).isActive( ))
{
return;
}
EditPartViewer viewer = getSourceEditPart( ).getViewer( );
EditPart parent = getSourceEditPart( ).getParent( );
if ( activeHelper == this
&& getSourceEditPart( ).isActive( )
&& viewer.getControl( ) != null
&& !viewer.getControl( ).isDisposed( ) )
{
viewer.getControl().removeFocusListener(focus);
viewer.getControl().removeKeyListener(key);
if ( viewer.getSelectedEditParts( ).size( ) == 1 )
{
if ( parent.getAdapter( IDelaySelectionDragTracker.class ) != null )
{
proxy = (IDelaySelectionDragTracker) parent.getAdapter( IDelaySelectionDragTracker.class );
if ( viewer instanceof DeferredGraphicalViewer )
( (DeferredGraphicalViewer) viewer ).setSelection( new StructuredSelection( proxy.getSourceEditPart( ) ),
true );
if ( getSourceEditPart( ) != getEditPartUnderMouse( ) )
{
IFigure figure = ( (GraphicalEditPart) getSourceEditPart( ) ).getFigure( );
Rectangle center = figure.getBounds( ).getCopy( );
figure.translateToAbsolute( center );
proxy.setStartLocation( center.getCenter( ) );
}
else
{
proxy.setStartLocation( getStartLocation( ) );
}
//
proxy.setState( STATE_DRAG_IN_PROGRESS );
}
setFlag( FLAG_DELAY_SELECTION, true );
}
else
{
setFlag( FLAG_DELAY_SELECTION, false );
}
}
else
{
setFlag( FLAG_DELAY_SELECTION, false );
}
activeHelper = null;
}