input
stringlengths
10
828
output
stringlengths
5
107
public void set selection type element type fire property change type selection null type
set a certain type element as selected
public boolean is show methods return show methods
true if methods should be displayed
public void set show methods boolean show methods this show methods show methods
indicates whether methods should be displayed
public boolean is show des return show des
true if declaration elements should be displayed
public void set show des boolean show des this show des show des
indicates whether declaration elements should be displayed
public edit part create edit part edit part context object model edit part part null if model instanceof diagram part new diagram part else if model instanceof type element part new type part else if model instanceof inheritance part new inheritance part part set model model return part
creates an edit part
public diagram get diagram return diagram get model
returns the model of the diagram
public boolean is selectable return false
the diagram is not selectable
private composite add dialog parts composite parent composite composite new composite parent swt none composite set layout new grid layout graph add graph composite add separator composite package and type name add name and package inputs composite return composite
adds the several parts to the main composite
public void activate super activate type element t get type t add property change listener this
activates the part
public void deactivate super deactivate type element t get type t remove property change listener this
deactivates the part
public type element get type return type element get model
returns the type
public void property change property change event evt string property evt get property name if type element type name equals property type element type type equals property umltype figure table figure umltype figure get figure table figure update label graphical edit part graphical edit part graphical edit part get viewer get contents ifigure part figure graphical edit part get figure part figure get update manager perform update
called upon changes in the model
public void set source edit part edit part super set source edit part
sets the source
public void set target edit part edit part super set target edit part
sets the target
public void update label if type is abstract type is interface type element label set font italic font else type element label set font normal font type element label set text type get fully qualified name type element label set icon type is interface icon interface icon class
updates the display of this figure according to changes in the model
private void input erroneous string msg set message msg imessage provider error set page complete false no input error false
settings if input is erroneous
public void set stroked out boolean stroked out this stroked out stroked out
sets whether the method name appears stroked out
private void show warning string msg set message msg imessage provider warning no input error true set page complete can be finished
shows a warning message
public boolean visit variable declaration fragment node if node null return true simple name declared variable name node get name expression initializer expr node get initializer if initializer expr null declared variable name null return true ilog log ilog log ast 4 visiting variable declaration fragment node to string ilog log ilog log ast 4 simple name of declared variable declared variable name class declared variable name get class ilog log ilog log ast 4 initializer expression initializer expr to string expression class initializer expr get class n treat assignment declared variable name initializer expr return true
visiting variable declaration fragments
public boolean visit method invocation node if node null return true ilog log ilog log ast 4 visiting method invocation node to string treat invocation node resolve method binding node arguments return true
visiting method invocations
private void check for existence string fq type name throws validation exception try find type only works on top level types this is not a problem here as we introduce a top level type if project find type fq type name null throw new validation exception a type with the fully qualified name fq type name already exists catch java model exception e e print stack trace
checks if a type is already existing
public boolean visit super method invocation node if node null return true ilog log ilog log ast 4 visiting super method invocation node to string treat invocation node resolve method binding node arguments return true
visiting supermethod invocations
public boolean visit class instance creation node if node null return true ilog log ilog log ast 4 visiting class instance creation node to string treat invocation node resolve constructor binding node arguments return true
visiting class instance creations
public boolean visit constructor invocation node if node null return true ilog log ilog log ast 4 visiting constructor invocation node to string treat invocation node resolve constructor binding node arguments return true
visiting constructor invocations
public boolean visit super constructor invocation node if node null return true ilog log ilog log ast 4 visiting super constructor invocation node to string treat invocation node resolve constructor binding node arguments return true
visiting super constructor invocations
private itype binding get declaring type astnode node astnode cnode node while cnode null if cnode instanceof type declaration return type declaration cnode resolve binding cnode cnode get parent return null
this method determines the enclosing type declaration of an astnode and
public string get fqname of type to be created if package text get text equals return name text get text return package text get text name text get text
returns the full qualified name of the type to be created
private imethod binding get declaring method astnode node astnode cnode node while cnode null if cnode instanceof method declaration method declaration method declaration method declaration cnode return method declaration resolve binding cnode cnode get parent return null
this method determines the enclosing method declaration of an astnode and
private void set editing boolean f name text set enabled f package text set enabled f interface radio set enabled f class radio set enabled f package browse button set enabled f open in editor checkbox set enabled f editing f
sets whether the wizard page is in editing mode
public boolean visit variable declaration expression node return extract fragments new variable declaration expression statement node
for statement variables
public boolean visit variable declaration statement node return extract fragments new variable declaration expression statement node
visiting local variables
public itype binding get binding return binding
returns the binding of this type
public string get fully qualified name return fq type name
returns the fully qualified name of this type
public boolean is new type return is new type element
true if this is a new type
public boolean is may be class return may be class
true if this interface may also be a class
public void set may be class boolean may be class this may be class may be class if is interface may be class is interface true
sets the maybeclass field
public void set may be interface boolean may be interface this may be interface may be interface if is interface may be interface is interface false
sets the maybeinterface field
public string get kind as string return kinds get kind
returns the name of the kind of the declaration element
public boolean is may be interface return may be interface
true if this class may be an interface
public void set local invocations deset key local invocations this local invocations new deset signature local invocations
sets the local invocations of the declaration element
public void set is new type boolean b is new type element b as per request 2005 04 25 open in editor is new type element
sets the isnewtype field
public deset signature get local invocations return this local invocations
returns the local invocations of the declaration element
public boolean is abstract if is new type element return true if is interface return true return modifier is abstract binding get modifiers
true if this type is an abstract class or an interface
public deset signature get transitive invocations deset signature transitive invocations new deset signature visited des new deset key determine transitive invocations this transitive invocations return transitive invocations
returns the transitive invocations of the declaration element
public void set fully qualified name string fq type name if this fq type name equals fq type name this fq type name fq type name fire property change type name null fq type name
sets the fully qualified name used for new types
private void determine transitive invocations declaration element de deset signature invocs if visited des contains declaration de return visited des add declaration de deset signature li de get local invocations deset key oa de get out assignments invocs add declarations li for iterator iter oa de iterator iter has next determine transitive invocations declaration element iter next invocs
this method recursively determines the transitive invocations for the given
public void set out assignments deset key transitive out assignments this out assignments transitive out assignments
sets the out assignments of the declaration element
public void set is interface boolean is interface if this is interface is interface this is interface is interface fire property change type type null new boolean is interface
sets the is interface field used for new types
public deset key get out assignments return out assignments
returns the out assignments of the declaration element
public boolean is open in editor return open in editor
true if this type is to be opened in the editor
public deset key get transitive out assignments deset key transitive out assignments new deset key visited des new deset key determine transitive out assignments this transitive out assignments return transitive out assignments
returns the transitive out assignments of the declaration element
public void set open in editor boolean open in editor this open in editor open in editor
sets the open in editor field
private void determine transitive out assignments declaration element de deset key out assignments if visited des contains declaration de return visited des add declaration de out assignments add declarations de get out assignments for iterator iter de get out assignments de iterator iter has next determine transitive out assignments declaration element iter next out assignments
this method determines recursively the transitive out assignments for the given
public string get fully qualified name of type return get first get fully qualified name of type
returns the fully qualified name of the type of all of the
public string get beautified name string buffer buf new string buffer for iterator i declaration elements de iterator i has next single declaration element d single declaration element i next buf append d get beautified name if declaration elements size 0 buf delete char at buf length 1 buf append return buf to string
returns a beaufified name of this composite element
public boolean equals object o if o instanceof composite declaration element composite declaration element other composite declaration element o if this declaration elements size other declaration elements size bugfix i don t believe it compare it with the other declaration elements please thank you return declaration elements contains declarations other declaration elements return false
this method is crucial to the success of the mission
public int get kind return get first get kind
returns the kind of this element
public void add inherited members deset signature declaration elements inherited members add declarations declaration elements
adds inherited members used for new types
public void add declared members deset signature declaration elements declared members add declarations declaration elements
adds declared members used for new types
public void add superfluous members deset signature declaration elements bugfix some members may not be present in this type for iterator i declaration elements de iterator i has next declaration element current declaration element i next if this get declared members contains declaration current superfluous members add declaration current
adds superfluous members used for new types
public single declaration element get first single declaration element first single declaration element declaration elements de iterator next return first
returns the first element from this composite
public int all member count return get all members size
returns the count of all members
public boolean contains all members deset key members return get all members contains declarations members
checks whether all members in the list are contained in this element
public type set get all super types type set tmp new type set tmp add types declared supertypes tmp add types inherited supertypes return tmp
returns all directly or indirectly implemented supertypes
public deset key get declaration elements return declaration elements
returns the declaration elements
public type set get declared supertypes return declared supertypes
returns all declared direct supertypes
public type set get inherited supertypes return inherited supertypes
returns all inherited non direct supertypes
public void add declared supertype type element type declared supertypes add type type
adds a new declared supertype
public void add inherited supertype type set types inherited supertypes add types types
adds a new inherited supertype
public boolean remove declared supertype type element type return declared supertypes remove type type
removes a declared supertype
public itype binding get declaring class return declaring class
returns the declaring class only one
public string to string return get complete information return get fully qualified name of type get beautified name
method to string
public boolean has direct supertype type element el return declared supertypes contains el
returns true if el is a direct supertype of this element
public string get fully qualified name of type if binding instanceof ivariable binding return ivariable binding binding get type get qualified name if binding instanceof imethod binding return imethod binding binding get return type get qualified name return
returns the fully qualified name of this element
public boolean has superclass for iterator i declared supertypes get as list iterator i has next type element current type element i next if current is interface current get fully qualified name equals java lang object return true return false
returns true if this element has a superclass
public string get beautified name if binding instanceof ivariable binding return binding get name if binding instanceof imethod binding return get representative string of method imethod binding binding return unknown
returns a beaufified name of this element
public boolean has supertype type element el return has direct supertype el inherited supertypes contains el
returns true if el is a direct or indirect supertype of this type
public boolean equals object o if o instanceof type element type element other type element o if this binding null other binding null return get fully qualified name equals other get fully qualified name if other binding get key null this binding get key null return util type names get qualified name for all types of types other binding equals util type names get qualified name for all types of types this binding return other binding get key equals this binding get key return false
normally elements are compared using their key
public int hash code use the complete information for hashing very important as this element will be part of many hashed lists maps sets you name it return get complete information hash code
method hash code
public int hash code return binding null get fully qualified name hash code binding get key null binding get qualified name hash code binding get key hash code
method hash code
public int get kind switch binding get kind case ibinding package return package case ibinding type itype binding b itype binding binding if b is interface return interface return class case ibinding method return method case ibinding variable ivariable binding b ivariable binding binding if b is field return field else if is parameter return parameter else return localvariable default return unknown
returns the kind of this element one of the constants from declaration element
public string to string return get fully qualified name
method to string
public string get simple name return binding get name
returns the simple name of this element
public void set binding itype binding type binding this binding type binding
sets the type binding used for new types
public itype binding get declared type return declared type
returns the declared type of this element
public deset signature get des affected by this type return des affected by this type
returns the declaration elements declared with this type
public void add affected de declaration element de des affected by this type add declaration de
add an affected declaration element for this type
public void add property change listener property change listener l listeners add property change listener l
method add property change listener
public void remove property change listener property change listener l listeners remove property change listener l
method remove property change listener
protected void fire property change string prop object old object new value listeners fire property change prop old new value
informs the listeners about a property change
private void filter out assignments for iterator i out assignment elements of current de de iterator i has next declaration element current out assignment declaration element i next if is valid type current out assignment get declared type i remove
filter all out assignments to declaration elements declared with a
private boolean is valid type itype binding declared type return valid types contains declared type declared type get qualified name equals java lang object declared type is array
checks if the given type is a valid one
public deset key get invocations return invocations of current de
returns the invocations
public deset key get out assignments return out assignment elements of current de
returns the out assignments
private boolean is method declared in java lang object imethod binding method binding return method binding get declaring class get qualified name equals java lang object
this method checks if a method is declared in java
public void add declarations deset key collection of declaration elements for iterator i collection of declaration elements de iterator i has next add declaration declaration element i next
adds several declarations
public boolean contains declarations deset key element for iterator i element de iterator i has next declaration element de declaration element i next if contains declaration de return false return true
checks if this set contains the given set
public type set get all types return all types
returns all types of the hierarchy including root
public type set get super types type set set new type set set add types all types set remove type root return set
returns all types of the hierarchy excluding root