public static void customizeItem ( final Component component, final Item item, final CustomizationRequest request ) { final List<CustomizationPipeline> pipelines = new LinkedList<> (); pipelines.add ( component.getCustomizationPipeline () ); ComponentWorld system = null; Level currentLevel = component.getLevel (); while ( currentLevel != null ) { pipelines.add ( currentLevel.getCustomizationPipeline () ); if ( currentLevel.getParent () == null && currentLevel.eContainer () instanceof ComponentWorld ) { // we found to root of all system = (ComponentWorld)currentLevel.eContainer (); } currentLevel = currentLevel.getParent (); } if ( system != null ) { pipelines.add ( system.getDefaultCustomizationPipeline () ); } new CustomizationRunner ( pipelines ).run ( item, request ); }
public static boolean isArchived ( final Component component, final Item item, final CustomizationRequest request ) { final List<Selector> selectors = new LinkedList<> (); selectors.add ( component.getArchiveSelector () ); ComponentWorld system = null; Level currentLevel = component.getLevel (); while ( currentLevel != null ) { selectors.add ( currentLevel.getArchiveSelector () ); if ( currentLevel.getParent () == null && currentLevel.eContainer () instanceof ComponentWorld ) { // we found to root of all system = (ComponentWorld)currentLevel.eContainer (); } currentLevel = currentLevel.getParent (); } if ( system != null ) { selectors.add ( system.getDefaultArchiveSelector () ); } return new SelectorRunner ( selectors ).run ( item, request, false ); }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public Object getStyledText ( final Object object ) { final StyledString styledLabel = new StyledString (); final String label = ( (Level)object ).getName (); if ( label != null && !label.isEmpty () ) { styledLabel.append ( label ); } final String description = ( (Level)object ).getDescription (); if ( description != null && !description.isEmpty () ) { styledLabel.append ( " (" + description + ")", StyledString.Style.DECORATIONS_STYLER ); //$NON-NLS-1$ //$NON-NLS-2$ } return styledLabel; }
private String makeParents ( final Object element ) { if ( ! ( element instanceof EObject ) ) { return null; } final LinkedList<String> hierarchy = new LinkedList<> (); EObject current = ( (EObject)element ).eContainer (); while ( current instanceof Level ) { hierarchy.add ( 0, ( (Level)current ).getName () ); current = current.eContainer (); } return StringHelper.join ( hierarchy, "." ); } }
public static boolean isArchived ( final Component component, final Item item, final CustomizationRequest request ) { final List<Selector> selectors = new LinkedList<> (); selectors.add ( component.getArchiveSelector () ); ComponentWorld system = null; Level currentLevel = component.getLevel (); while ( currentLevel != null ) { selectors.add ( currentLevel.getArchiveSelector () ); if ( currentLevel.getParent () == null && currentLevel.eContainer () instanceof ComponentWorld ) { // we found to root of all system = (ComponentWorld)currentLevel.eContainer (); } currentLevel = currentLevel.getParent (); } if ( system != null ) { selectors.add ( system.getDefaultArchiveSelector () ); } return new SelectorRunner ( selectors ).run ( item, request, false ); }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public Object getStyledText ( final Object object ) { final StyledString styledLabel = new StyledString (); final String label = ( (Level)object ).getName (); if ( label != null && !label.isEmpty () ) { styledLabel.append ( label ); } final String description = ( (Level)object ).getDescription (); if ( description != null && !description.isEmpty () ) { styledLabel.append ( " (" + description + ")", StyledString.Style.DECORATIONS_STYLER ); //$NON-NLS-1$ //$NON-NLS-2$ } return styledLabel; }
private String makeParents ( final Object element ) { if ( ! ( element instanceof EObject ) ) { return null; } final LinkedList<String> hierarchy = new LinkedList<> (); EObject current = ( (EObject)element ).eContainer (); while ( current instanceof Level ) { hierarchy.add ( 0, ( (Level)current ).getName () ); current = current.eContainer (); } return StringHelper.join ( hierarchy, "." ); } }
public static void customizeItem ( final Component component, final Item item, final CustomizationRequest request ) { final List<CustomizationPipeline> pipelines = new LinkedList<> (); pipelines.add ( component.getCustomizationPipeline () ); ComponentWorld system = null; Level currentLevel = component.getLevel (); while ( currentLevel != null ) { pipelines.add ( currentLevel.getCustomizationPipeline () ); if ( currentLevel.getParent () == null && currentLevel.eContainer () instanceof ComponentWorld ) { // we found to root of all system = (ComponentWorld)currentLevel.eContainer (); } currentLevel = currentLevel.getParent (); } if ( system != null ) { pipelines.add ( system.getDefaultCustomizationPipeline () ); } new CustomizationRunner ( pipelines ).run ( item, request ); }