本文整理匯總了Java中org.eclipse.emf.edit.domain.EditingDomain.getNewChildDescriptors方法的典型用法代碼示例。如果您正苦於以下問題:Java EditingDomain.getNewChildDescriptors方法的具體用法?Java EditingDomain.getNewChildDescriptors怎麽用?Java EditingDomain.getNewChildDescriptors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.emf.edit.domain.EditingDomain
的用法示例。
在下文中一共展示了EditingDomain.getNewChildDescriptors方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: selectionChanged
import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void selectionChanged(SelectionChangedEvent event) {
// Remove any menu items for old selection.
//
if (createChildMenuManager != null) {
depopulateManager(createChildMenuManager, createChildActions);
}
if (createSiblingMenuManager != null) {
depopulateManager(createSiblingMenuManager, createSiblingActions);
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions(newChildDescriptors, selection);
createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
if (createChildMenuManager != null) {
populateManager(createChildMenuManager, createChildActions, null);
createChildMenuManager.update(true);
}
if (createSiblingMenuManager != null) {
populateManager(createSiblingMenuManager, createSiblingActions, null);
createSiblingMenuManager.update(true);
}
}
示例2: selectionChanged
import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void selectionChanged ( SelectionChangedEvent event )
{
// Remove any menu items for old selection.
//
if ( createChildMenuManager != null )
{
depopulateManager ( createChildMenuManager, createChildActions );
}
if ( createSiblingMenuManager != null )
{
depopulateManager ( createSiblingMenuManager, createSiblingActions );
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection ();
if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
{
Object object = ( (IStructuredSelection)selection ).getFirstElement ();
EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();
newChildDescriptors = domain.getNewChildDescriptors ( object, null );
newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
if ( createChildMenuManager != null )
{
populateManager ( createChildMenuManager, createChildActions, null );
createChildMenuManager.update ( true );
}
if ( createSiblingMenuManager != null )
{
populateManager ( createSiblingMenuManager, createSiblingActions, null );
createSiblingMenuManager.update ( true );
}
}
示例3: selectionChanged
import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings that can
* be added to the selected object and updating the menus accordingly. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void selectionChanged ( final SelectionChangedEvent event )
{
// Remove any menu items for old selection.
//
if ( this.createChildMenuManager != null )
{
depopulateManager ( this.createChildMenuManager, this.createChildActions );
}
if ( this.createSiblingMenuManager != null )
{
depopulateManager ( this.createSiblingMenuManager, this.createSiblingActions );
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
final ISelection selection = event.getSelection ();
if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
{
final Object object = ( (IStructuredSelection)selection ).getFirstElement ();
final EditingDomain domain = ( (IEditingDomainProvider)this.activeEditorPart ).getEditingDomain ();
newChildDescriptors = domain.getNewChildDescriptors ( object, null );
newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
}
// Generate actions for selection; populate and redraw the menus.
//
this.createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
this.createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
if ( this.createChildMenuManager != null )
{
populateManager ( this.createChildMenuManager, this.createChildActions, null );
this.createChildMenuManager.update ( true );
}
if ( this.createSiblingMenuManager != null )
{
populateManager ( this.createSiblingMenuManager, this.createSiblingActions, null );
this.createSiblingMenuManager.update ( true );
}
}
示例4: selectionChanged
import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void selectionChanged ( SelectionChangedEvent event )
{
// Remove any menu items for old selection.
//
if ( createChildMenuManager != null )
{
depopulateManager ( createChildMenuManager, createChildSubmenuActions );
depopulateManager ( createChildMenuManager, createChildActions );
}
if ( createSiblingMenuManager != null )
{
depopulateManager ( createSiblingMenuManager, createSiblingSubmenuActions );
depopulateManager ( createSiblingMenuManager, createSiblingActions );
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection ();
if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
{
Object object = ( (IStructuredSelection)selection ).getFirstElement ();
EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();
newChildDescriptors = domain.getNewChildDescriptors ( object, null );
newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
createChildSubmenuActions = extractSubmenuActions ( createChildActions );
createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
createSiblingSubmenuActions = extractSubmenuActions ( createSiblingActions );
if ( createChildMenuManager != null )
{
populateManager ( createChildMenuManager, createChildSubmenuActions, null );
populateManager ( createChildMenuManager, createChildActions, null );
createChildMenuManager.update ( true );
}
if ( createSiblingMenuManager != null )
{
populateManager ( createSiblingMenuManager, createSiblingSubmenuActions, null );
populateManager ( createSiblingMenuManager, createSiblingActions, null );
createSiblingMenuManager.update ( true );
}
}
示例5: selectionChanged
import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void selectionChanged ( SelectionChangedEvent event )
{
// Remove any menu items for old selection.
//
if ( createChildMenuManager != null )
{
depopulateManager ( createChildMenuManager, createChildSubmenuActions );
depopulateManager ( createChildMenuManager, createChildActions );
}
if ( createSiblingMenuManager != null )
{
depopulateManager ( createSiblingMenuManager, createSiblingSubmenuActions );
depopulateManager ( createSiblingMenuManager, createSiblingActions );
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection ();
if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
{
Object object = ( (IStructuredSelection)selection ).getFirstElement ();
EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();
newChildDescriptors = domain.getNewChildDescriptors ( object, null );
newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
createChildSubmenuActions = extractSubmenuActions ( createChildActions );
createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
createSiblingSubmenuActions = extractSubmenuActions ( createSiblingActions );
if ( createChildMenuManager != null )
{
populateManager ( createChildMenuManager, createChildSubmenuActions, null );
populateManager ( createChildMenuManager, createChildActions, null );
createChildMenuManager.update ( true );
}
if ( createSiblingMenuManager != null )
{
populateManager ( createSiblingMenuManager, createSiblingSubmenuActions, null );
populateManager ( createSiblingMenuManager, createSiblingActions, null );
createSiblingMenuManager.update ( true );
}
}
示例6: selectionChanged
import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void selectionChanged ( SelectionChangedEvent event )
{
// Remove any menu items for old selection.
//
if ( createChildMenuManager != null )
{
depopulateManager ( createChildMenuManager, createChildActions );
}
if ( createSiblingMenuManager != null )
{
depopulateManager ( createSiblingMenuManager, createSiblingActions );
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection ();
if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
{
Object object = ( (IStructuredSelection)selection ).getFirstElement ();
EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();
newChildDescriptors = domain.getNewChildDescriptors ( object, null );
newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
if ( createChildMenuManager != null )
{
populateManager ( createChildMenuManager, createChildActions, null );
createChildMenuManager.update ( true );
}
if ( createSiblingMenuManager != null )
{
populateManager ( createSiblingMenuManager, createSiblingActions, null );
createSiblingMenuManager.update ( true );
}
}