Completion for exceptions

Jiri Pejchal <[email protected]> Fri, 15 Sep 2006 23:24:24 +0200
Newsgroups gmane.emacs.jdee
Message-ID <[email protected]>
Hi,

I've started to use the following code for the completition of
exceptions.

You need to replace (p \"catch what: \" clause) in
jde-gen-cflow-try-catch and jde-gen-cflow-finally
with (george-jde-complete-exception)

Do you find it useful? Maybe something similar could be added to
jdee...

Jiri Pejchal

(defvar george-jde-exception-history nil
  "History list of recent eceptions.")

(defvar george-jde-exceptions (list
			       "Exception"
			       ;; java.lang.Exception
			       "AclNotFoundException"
			       "ActivationException"
			       "AlreadyBoundException"
			       "ApplicationException"
			       "AWTException"
			       "BackingStoreException"
			       "BadAttributeValueExpException"
			       "BadBinaryOpValueExpException"
			       "BadLocationException"
			       "BadStringOperationException"
			       "BrokenBarrierException"
			       "CertificateException"
			       "ClassNotFoundException"
			       "CloneNotSupportedException"
			       "DataFormatException"
			       "DatatypeConfigurationException"
			       "DestroyFailedException"
			       "ExecutionException"
			       "ExpandVetoException"
			       "FontFormatException"
			       "GeneralSecurityException"
			       "GSSException"
			       "IllegalAccessException"
			       "IllegalClassFormatException"
			       "InstantiationException"
			       "InterruptedException"
			       "IntrospectionException"
			       "InvalidApplicationException"
			       "InvalidMidiDataException"
			       "InvalidPreferencesFormatException"
			       "InvalidTargetObjectTypeException"
			       "InvocationTargetException"
			       "IOException"
			       "JMException"
			       "LastOwnerException"
			       "LineUnavailableException"
			       "MidiUnavailableException"
			       "MimeTypeParseException"
			       "NamingException"
			       "NoninvertibleTransformException"
			       "NoSuchFieldException"
			       "NoSuchMethodException"
			       "NotBoundException"
			       "NotOwnerException"
			       "ParseException"
			       "ParserConfigurationException"
			       "PrinterException"
			       "PrintException"
			       "PrivilegedActionException"
			       "PropertyVetoException"
			       "RefreshFailedException"
			       "RemarshalException"
			       "RuntimeException"
			       "SAXException"
			       "ServerNotActiveException"
			       "SQLException"
			       "TimeoutException"
			       "TooManyListenersException"
			       "TransformerException"
			       "UnmodifiableClassException"
			       "UnsupportedAudioFileException"
			       "UnsupportedCallbackException"
			       "UnsupportedFlavorException"
			       "UnsupportedLookAndFeelException"
			       "URISyntaxException"
			       "UserException"
			       "XAException"
			       "XMLParseException"
			       "XPathException"
			       ;;java.lang.RuntimeException
			       "AnnotationTypeMismatchException"
			       "ArithmeticException"
			       "ArrayStoreException"
			       "BufferOverflowException"
			       "BufferUnderflowException"
			       "CannotRedoException"
			       "CannotUndoException"
			       "ClassCastException"
			       "CMMException"
			       "ConcurrentModificationException"
			       "DOMException"
			       "EmptyStackException"
			       "EnumConstantNotPresentException"
			       "EventException"
			       "IllegalArgumentException"
			       "IllegalMonitorStateException"
			       "IllegalPathStateException"
			       "IllegalStateException"
			       "ImagingOpException"
			       "IncompleteAnnotationException"
			       "IndexOutOfBoundsException"
			       "JMRuntimeException"
			       "LSException"
			       "MalformedParameterizedTypeException"
			       "MissingResourceException"
			       "NegativeArraySizeException"
			       "NoSuchElementException"
			       "NullPointerException"
			       "ProfileDataException"
			       "ProviderException"
			       "RasterFormatException"
			       "RejectedExecutionException"
			       "SecurityException"
			       "SystemException"
			       "TypeNotPresentException"
			       "UndeclaredThrowableException"
			       "UnmodifiableSetException"
			       "UnsupportedOperationException"
			       ;;IOException
			       "ChangedCharSetException"
			       "CharacterCodingException"
			       "CharConversionException"
			       "ClosedChannelException"
			       "EOFException"
			       "FileLockInterruptionException"
			       "FileNotFoundException"
			       "HttpRetryException"
			       "IIOException"
			       "InterruptedIOException"
			       "InvalidPropertiesFormatException"
			       "JMXProviderException"
			       "JMXServerErrorException"
			       "MalformedURLException"
			       "ObjectStreamException"
			       "ProtocolException"
			       "RemoteException"
			       "SaslException"
			       "SocketException"
			       "SSLException"
			       "SyncFailedException"
			       "UnknownHostException"
			       "UnknownServiceException"
			       "UnsupportedEncodingException"
			       "UTFDataFormatException"
			       "ZipException"

			       "NumberFormatException"
			       ))

(defun george-jde-complete-exception()
  (completing-read
   "Exception: "
   george-jde-exceptions
   nil nil nil 'george-jde-exception-history
   ))