Yup... The problem seems to be here -
(defun jde-import-get-import-insertion-point ()
(let ((ip-re
(list (cons "import[ ]+\\(.*\\)[ ]*;" 'backward)
;************************* 'backward is the problem
(cons "package[ \t]+\\(.*\\)[ \t]*;" 'backward)
(cons "^$" 'forward)))
:
:-------------------8<---------- snipped ---------8<---
:
:
insertion-point))
In one of my programs I had to write "import" as "imp" + "ort" to beat
the wrong insertion.
Sandip V. Chitale 150, Almaden Blvd
work: (408) 535 1791 ext: 791 San Jose, CA, USA
email: [EMAIL PROTECTED] 8th floor, Cube 831
web: http://L064-5440.blazesoft.com
> -----Original Message-----
> From: Schewe, Jon (MN65) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 08, 2001 12:24 PM
> To: Jde List (E-mail)
> Subject: jde-import-find-and-import puts imports in wrong place
>
>
> This isn't a real big deal since it shouldn't come up much,
> but if you've
> got a java class which contains a string with an import
> statement inside it
> jde-import-find-and-import inserts the new import after this
> line rather
> than after the real import lines.
>
> So I've got a class with this in it:
> import javax.swing.JPanel;
> //more imports
> //new import should go here
>
> public class foo {
> //....
> /**
> * Get a panel that allows debugging through DynamicJava.
> The variable
> * plant is mapped to the current plant.
> */
> final public JPanel createDynamicJavaPanel() {
> final Interpreter interpreter = new TreeInterpreter(new
> JavaCCParserFactory());
> final JPanel panel = new JPanel(new BorderLayout());
>
> final StringBuffer message = new StringBuffer();
> message.append("The domain package is already imported
> and the following
> variables have been defined: ");
> message.append(System.getProperty("line.separator"));
> message.append("plant");
> message.append(System.getProperty("line.separator"));
> message.append("scheduler");
> message.append(System.getProperty("line.separator"));
>
> final JTextArea code = new JTextArea("/*" +
> message.toString() + "*/\n",
> 24, 80);
> panel.add(new JScrollPane(code), BorderLayout.CENTER);
> final JButton button = new JButton("Evaluate");
> button.addActionListener(new ActionListener() {
> public void actionPerformed(final ActionEvent ae) {
> try {
> interpreter.interpret(new StringReader(code.getText()),
> "topLevel");
> } catch (final InterpreterException e) {
> System.err.println(e.getMessage());
> e.printStackTrace();
> }
> }
> });
> panel.add(button, BorderLayout.SOUTH);
>
> interpreter.defineVariable("plant", getPlant());
> interpreter.defineVariable("scheduler", getScheduler());
>
> try {
> interpreter.interpret(new StringReader("import
> com.honeywell.sydneypoc.domain.*;"), "topLevel");
> //new import shows up here
> } catch (final InterpreterException e) {
> System.err.println(e.getMessage());
> e.printStackTrace();
> }
>
> return panel;
> }
> //...
> }
>
> ---
> Jon Schewe | [EMAIL PROTECTED]
> *My views may not represent those of my employers
>
>