Co można zrobić, to dodać normalny skrót kodu (Java -> Edytor -> Szablony),
czyli zrobić szablon edytora „newcustomclass” być zawartość klasy mówisz .
Następnie utwórz nową klasę Java w normalny sposób, usuń całą zawartość, a następnie użyj szablonu kodu "newcustomclass", aby utworzyć nową klasę auto java.
Oto przykład prostego klasy wyjątek:
public class ${enclosing_type} extends Exception {
/**
* Constructs with the given throwable
* @param t the throwable to throw
*/
public ${enclosing_type}(Throwable t) {
super(t);
}
/**
* Constructs with the given message
* @param message the message of the exception
*/
public ${enclosing_type}(String message) {
super(message);
}
/**
* Constructs with the given message and the original throwable cause
* @param message the message of the exception
* @param t the original throwable
*/
public ${enclosing_type}(String message, Throwable t) {
super(message, t);
}
}
Mike Myślę, że możesz rzucić okiem na moją wtyczkę. Robi coś podobnego. – fastcodejava
Czy to prawda? Czy nadal nie ma łatwego sposobu na stworzenie nowego "szablonu pliku" w czasie zaćmienia? – Peter
O ile mi wiadomo, tak, niestety nadal tak jest. W aktualnej wersji zaćmienia możesz mieć tylko fragmenty, ale nie nowe szablony klas. –