/** * Constructor. * @param app */ public InstanceContext( AbstractApplication app ) { this.name = app.getName(); this.qualifier = app instanceof ApplicationTemplate ? ((ApplicationTemplate) app).getVersion() : null; }
public File getTemplateDirectory() { return this.application.getTemplate().getDirectory(); }
@Override public Paint transform( AbstractType type ) { return type.equals( this.selectedComponent ) ? this.highlightBgcolor : this.defaultBgColor; } }
/** * Constructor. * @param instance */ public MsgCmdAddInstance( Instance instance ) { this.parentInstancePath = instance.getParent() == null ? null : InstanceHelpers.computeInstancePath( instance.getParent()); this.instanceName = instance.getName(); this.componentName = instance.getComponent() != null ? instance.getComponent().getName() : null; this.channels = instance.channels; this.data = instance.data; this.overridenExports = instance.overriddenExports; }
/** * Constructor. * @param instance */ public Import( Instance instance ) { this( InstanceHelpers.computeInstancePath( instance ), instance.getComponent() == null ? null : instance.getComponent().getName(), InstanceHelpers.findAllExportedVariables( instance )); }
public Graphs getGraphs() { return this.application.getTemplate().getGraphs(); }
/** * Finds the root instance for an instance. * @param instance an instance (not null) * @return a non-null instance, the root instance */ public static Instance findRootInstance( Instance instance ) { Instance rootInstance = instance; while( rootInstance.getParent() != null ) rootInstance = rootInstance.getParent(); return rootInstance; }
@Override protected String renderDocumentTitle() { return "# " + this.applicationTemplate.getName() + "\n\n"; }
/** * Constructor. * @param name */ public ApplicationTemplate( String name ) { setName( name ); }
/** * Constructor. * @param name * @param template */ public Application( String name, ApplicationTemplate template ) { this( template ); setName( name ); }
/** * @return the randomKind */ public RandomKind getRandomKind() { return RandomKind.whichValue( this.rawKind ); }
@Override public String toString() { return this.app.toString(); }
@Override public boolean equals( Object obj ) { return super.equals( obj ) && obj instanceof TestApplicationTemplate; }
/** * Removes the association between this application and its template. */ public void removeAssociationWithTemplate() { if( this.template != null ) this.template.removeApplicationAssocation( this ); }
/** * A secured alternative to {@link InstanceStatus#valueOf(String)}. * @param s a string (can be null) * @return the associated runtime status, or {@link InstanceStatus#NOT_DEPLOYED} otherwise */ public static InstanceStatus whichStatus( String s ) { InstanceStatus result = exactStatus( s ); return result == null ? NOT_DEPLOYED : result; }
@Override public boolean equals( Object obj ) { return obj instanceof TestApplication && super.equals( obj ); }
@Override public int hashCode() { return super.hashCode(); } }
@Override public int hashCode() { return super.hashCode(); } }
/** * Constructor. * @param instance */ public MsgCmdAddInstance( Instance instance ) { this.parentInstancePath = instance.getParent() == null ? null : InstanceHelpers.computeInstancePath( instance.getParent()); this.instanceName = instance.getName(); this.componentName = instance.getComponent() != null ? instance.getComponent().getName() : null; this.channels = instance.channels; this.data = instance.data; this.overridenExports = instance.overriddenExports; }
@Override public Paint transform( AbstractType type ) { return type.equals( this.selectedComponent ) ? this.highlightBgcolor : this.defaultBgColor; } }