Reputation: 653
Is it possible to move mutliple static methods and/or multiples static fields on one shot ?
public final class ClassA {
public static final String CONSTANTE_A = "CONSTANTE_A";
public static final String CONSTANTE_B = "CONSTANTE_B";
public static void methodA() {
// statements....
}
public static void methodB() {
// statements....
}
}
public final class ClassB {
// empty class
}
I would like to be able to select methodA, methodB, CONSTANTE_A and CONSTANTE_B, and do a "move..." to ClassB
Upvotes: 9
Views: 3549
Reputation: 794
Expand until you see the static methods or varibles. Select all that you want to move. Right click. Select Refactor. Then choose the class where you want to move. Click OK. That will not just copy and paste but will refactor (update references to those methods and variables).
Upvotes: 22
Reputation: 1900
The easiest way to do this is to drag and drop the variables in Eclipse's package explorer. Expand ClassA until you see your static variables listed under your class and select both of them -- control + click (pc) or command + click (mac). Then just drag them to the desired destination class.
Upvotes: 4