TS 68 JavaFX Refactoring
Refactoring
Author: Alexandr Scherbatiy
Version: 1.1
Last update: 25 September 2009
Introduction:
Comments:
Contents |
Refactoring Ubrella issue: 173077
What | Issues |
---|---|
Variable | |
name | 172739 |
type | |
Function | |
name | |
argument | 172147 |
return type | |
body | |
Sequence | |
name | 172145 |
Package | |
name | |
D&D | |
Class | |
name | 173259, 173252 |
attribute | ,173243 |
function | |
attribute scope | 173254 |
inheritance | 172165 |
mixin | |
Operators | |
while | 172751 |
for |
Variable
- Name
- Type in the editor:
- Type in the editor:
public var a = 10; public var b = a + 10;
- Refactor->Rename the a variable to c
- Code should be compilable
- The result should be
- Type
- Type in the editor:
- Type in the editor:
var a:A;
class A{}- Refactor->Rename the A type of the a variable to B
- Code should be compilable
- The result should be
Function
- Name
- Type in the editor:
- Type in the editor:
function f(x:Number):Number{ x * x}
- Refactor->Rename the f function to sqr
- Code should be compilable
- The result should be
- Argument
- Type in the editor:
- Type in the editor:
function sqr(x:Number):Number{ x * x}
- Refactor->Rename the x argument to y
- Code should be compilable
- The result should be
- Return Type
- Type in the editor:
- Type in the editor:
class A{} function f(a:A):A{ A{} }
- Refactor->Rename the A function return type to B
- Code should be compilable
- The result should be
Sequence
- Name
- Type in the editor:
- Type in the editor:
var seq = [1,2,3,4,5]; var sqr = for(n in seq) seq[[N | n]] * seq[N];
- Refactor->Rename the seq sequence to s
- Code should be compilable
- The result should be
Package
- Name
- Create a package
- Create A JavaFX class under the package
- Refactor->Rename the a package to b
- Code should be compilable
- The A class should have the b package
- Drag And Drop
- Create a package
- Create A JavaFX class under the package
- Create b package
- Drag and drop the A class to the b package
- Code should be compilable
- The A class should have the b package
- Default package
- Have a JavaFX class in any package
- Refactor -> Move it into empty package
- Class is moved without any error. There is no package line in source code
Class
- Name
- Type in the editor:
- Type in the editor:
class A{}; var a = A{};
function f(a:A):A { A{} }
- Refactor->Rename the A class to B
- Code should be compilable
- The result should be
- Attribute name
- Type in the editor:
- Type in the editor:
class A{
public var attr:String;
};
var a = A{ attr: "Hello World" };
println(a.attr);
- Refactor->Rename the attr attribute name to attr2
- Code should be compilable
- The result should be
- Attribute Type
- Type in the editor:
- Type in the editor:
class A{
public var attr:A;
};
var a = A{ attr: A{} };
- Refactor->Rename the A type of the attr_ attribute to B__
- Code should be compilable
- The result should be
- Attribute Default Value
- Type in the editor:
- Type in the editor:
class A{
public var attr:A = A{};
};
var a = A{ attr: A{} };
- Refactor->Rename the A default value of the attr_ attribute to B__
- Code should be compilable
- The result should be
- Inheritence
- Type in the editor:
- Type in the editor:
class A{} class B extends A{}
- Refactor->Rename the A class to D
- Code should be compilable
- The result should be
- Mixin
- Type in the editor:
- Type in the editor:
class A{} mixin class M{} class B extends A, M{}
- Refactor->Rename the M class to N
- Code should be compilable
- The result should be
Operators
- While loop
- Type in the editor:
- Type in the editor:
var f = true;
while(f){
f = not f;
}
- Refactor->Rename the f variable to g in the 'while(f){' line
- Code should be compilable
- The result should be
- For loop
- Type in the editor:
- Type in the editor:
var s = [1,2,3,4,5]; var t = for(n in s) s[N] * indexof n;
- Refactor->Rename the n loop variable to m
- Code should be compilable
- The result should be
-- Main.AlexandrScherbatiy - 22 Sep 2009