本文整理汇总了Java中org.eclipse.gef.ui.parts.ScrollingGraphicalViewer.setEditDomain方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollingGraphicalViewer.setEditDomain方法的具体用法?Java ScrollingGraphicalViewer.setEditDomain怎么用?Java ScrollingGraphicalViewer.setEditDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.ui.parts.ScrollingGraphicalViewer
的用法示例。
在下文中一共展示了ScrollingGraphicalViewer.setEditDomain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPartControl
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
public void createPartControl(Composite parent) {
// Create the viewer
viewer = new ScrollingGraphicalViewer();
viewer.setEditDomain(new UrnEditDomain(null));
viewer.createControl(parent);
// viewer.addSelectionChangedListener(this);
// -- getSite().setSelectionProvider(viewer);
getSite().getPage().addPartListener(this);
getSite().getPage().addSelectionListener(this);
// Set root editpart
root = new ScalableFreeformRootEditPart();
viewer.setRootEditPart(root);
// Register the view
DisplayPreferences.getInstance().registerListener(this);
}
示例2: createCubeArea
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer; //导入方法依赖的package包/类
private Composite createCubeArea( Composite parent )
{
Composite viewerContent = new Composite( parent, SWT.BORDER );
GridData gd = new GridData( GridData.FILL_BOTH );
gd.widthHint = 500;
gd.heightHint = 300;
viewerContent.setLayoutData( gd );
viewerContent.setLayout( new FillLayout( ) );
viewer = new ScrollingGraphicalViewer( );
EditDomain editDomain = new EditDomain( );
ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart( );
viewer.setRootEditPart( root );
viewer.setEditDomain( editDomain );
viewer.createControl( viewerContent );
viewer.getControl( ).setBackground( ColorConstants.listBackground );
factory = new GraphicalEditPartsFactory( );
viewer.setEditPartFactory( factory );
viewer.setKeyHandler( new GraphicalViewerKeyHandler( viewer ) );
viewer.addSelectionChangedListener( new ISelectionChangedListener( ) {
public void selectionChanged( SelectionChangedEvent event )
{
if ( event.getSelection( ) != null )
{
StructuredSelection selection = (StructuredSelection) event.getSelection( );
if ( selection.getFirstElement( ) instanceof HierarchyNodeEditPart
|| selection.getFirstElement( ) instanceof DatasetNodeEditPart )
{
Object obj = selection.getFirstElement( );
if ( obj instanceof HierarchyNodeEditPart )
{
TabularHierarchyHandle hierarchy = (TabularHierarchyHandle) ( (HierarchyNodeEditPart) obj ).getModel( );
if ( hierarchy.getPrimaryKeys( ) != null
&& hierarchy.getPrimaryKeys( ).size( ) > 0 )
{
filterButton.setEnabled( false );
}
else
filterButton.setEnabled( true );
}
else
filterButton.setEnabled( true );
}
else
filterButton.setEnabled( false );
}
else
filterButton.setEnabled( false );
}
} );
load( );
return viewerContent;
}