तुम कर सकते हो क्या एक सामान्य कोड शॉर्टकट जोड़ने है (जावा -> संपादक -> टेम्पलेट्स),
यानी एक संपादक टेम्पलेट बनाने के "newcustomclass" वर्ग के बारे में आप बात कर रहे हैं की सामग्री हो ।
फिर सामान्य जावा में नया जावा क्लास बनाएं, सभी सामग्री हटाएं और फिर नया ऑटो जावा क्लास बनाने के लिए "newcustomclass" कोड टेम्पलेट का उपयोग करें।
यहाँ एक सरल अपवाद वर्ग के लिए एक उदाहरण है:
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);
}
}
स्रोत
2010-01-21 14:09:01
माइक मुझे लगता है कि आप मेरे प्लग-इन को देख सकते हैं। यह कुछ ऐसा ही करता है। – fastcodejava
क्या वाकई सच है? ग्रहण में नया "फ़ाइल टेम्पलेट" बनाने का अभी भी कोई आसान तरीका नहीं है? – Peter
जहां तक मुझे पता है, हाँ, यह दुखद बात अभी भी मामला है। ग्रहण के स्टॉक संस्करण में आप केवल स्निपेट कर सकते हैं, लेकिन नए वर्ग टेम्पलेट्स नहीं। –