diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..0b68e54 --- /dev/null +++ b/.DS_Store Binary files differ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e0f15db --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic" +} \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..951d151 --- /dev/null +++ b/pom.xml @@ -0,0 +1,100 @@ + + 4.0.0 + istlab.TestRSyntaxTA + RSyntaxTA + jar + 1.0-SNAPSHOT + RSyntaxTA + http://maven.apache.org + + + 11 + UTF-8 + UTF-8 + 11 + 11 + + + + + + + + com.fifesoft + autocomplete + 3.2.0 + + + junit + junit + 3.8.1 + test + + + + + + + src/main/res + + + + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + istlab.TestRSyntaxTA.App + + + + + + maven-assembly-plugin + + + + + + + jar-with-dependencies + + + + + istlab.TestRSyntaxTA.App + + + all-permissions + . + + + + + + + + + + \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..38c840b --- /dev/null +++ b/src/.DS_Store Binary files differ diff --git a/src/main/.DS_Store b/src/main/.DS_Store new file mode 100644 index 0000000..3c86d58 --- /dev/null +++ b/src/main/.DS_Store Binary files differ diff --git a/src/main/java/.DS_Store b/src/main/java/.DS_Store new file mode 100644 index 0000000..18563db --- /dev/null +++ b/src/main/java/.DS_Store Binary files differ diff --git a/src/main/java/istlab/TestRSyntaxTA/App.java b/src/main/java/istlab/TestRSyntaxTA/App.java new file mode 100644 index 0000000..6342910 --- /dev/null +++ b/src/main/java/istlab/TestRSyntaxTA/App.java @@ -0,0 +1,38 @@ +package istlab.TestRSyntaxTA; + +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +/** + * Hello world! + * + */ +public class App { + public static void main(String[] args) { + // SwingUtilities.invokeLater(() -> { + // String laf = UIManager.getSystemLookAndFeelClassName(); + // //laf = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"; + // try { + // UIManager.setLookAndFeel(laf); + // } catch (Exception e) { + // e.printStackTrace(); + // } + // AutoCompleteDemoApp frame = new AutoCompleteDemoApp(); + // frame.getToolkit().setDynamicLayout(true); + // frame.setVisible(true); + // }); + + + // System.out.println("Hello World!"); + // Instantiate GUI on the EDT. + SwingUtilities.invokeLater(() -> { + try { + String laf = UIManager.getSystemLookAndFeelClassName(); + UIManager.setLookAndFeel(laf); + } catch (Exception e) { + /* Never happens */ } + new AutoCompleteDemo().setVisible(true); + }); + + } +} diff --git a/src/main/java/istlab/TestRSyntaxTA/AutoCompleteDemo.java b/src/main/java/istlab/TestRSyntaxTA/AutoCompleteDemo.java new file mode 100644 index 0000000..a2234ea --- /dev/null +++ b/src/main/java/istlab/TestRSyntaxTA/AutoCompleteDemo.java @@ -0,0 +1,167 @@ +package istlab.TestRSyntaxTA; + +import java.awt.BorderLayout; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.plaf.FontUIResource; + +import org.fife.ui.autocomplete.AutoCompletion; +import org.fife.ui.autocomplete.BasicCompletion; +import org.fife.ui.autocomplete.CompletionProvider; +import org.fife.ui.autocomplete.DefaultCompletionProvider; +import org.fife.ui.autocomplete.ShorthandCompletion; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +import org.fife.ui.rsyntaxtextarea.SyntaxConstants; +import org.fife.ui.rtextarea.RTextScrollPane; +import org.mdkt.compiler.InMemoryJavaCompiler; + +public class AutoCompleteDemo extends JFrame { + + RSyntaxTextArea textArea; + + public AutoCompleteDemo() { + + JPanel contentPane = new JPanel(new BorderLayout()); + textArea = new RSyntaxTextArea(20, 60); + textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); + textArea.setCodeFoldingEnabled(true); + textArea.setFont(new FontUIResource("sansserif", Font.PLAIN, 20)); + contentPane.add(new RTextScrollPane(textArea)); + + // A CompletionProvider is what knows of all possible completions, and + // analyzes the contents of the text area at the caret position to + // determine what completion choices should be presented. Most instances + // of CompletionProvider (such as DefaultCompletionProvider) are designed + // so that they can be shared among multiple text components. + CompletionProvider provider = createCompletionProvider(); + + // An AutoCompletion acts as a "middle-man" between a text component + // and a CompletionProvider. It manages any options associated with + // the auto-completion (the popup trigger key, whether to display a + // documentation window along with completion choices, etc.). Unlike + // CompletionProviders, instances of AutoCompletion cannot be shared + // among multiple text components. + AutoCompletion ac = new AutoCompletion(provider); + ac.install(textArea); + + setContentPane(contentPane); + setTitle("AutoComplete Demo"); + setDefaultCloseOperation(EXIT_ON_CLOSE); + + JPanel north = new JPanel(); + JButton loadB = new JButton("Load"); + loadB.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + InputStream is = getClass().getResourceAsStream("/Hello.java"); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + StringBuilder sb = new StringBuilder(); + String line; + try { + while((line=br.readLine())!=null){ + sb.append(line+"\n"); + } + } catch (IOException e1) { + e1.printStackTrace(); + } + textArea.setText(sb.toString()); + + } + }); + north.add(loadB); + + JButton saveB = new JButton("Save"); + saveB.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + System.out.println(textArea.getText()); + } + }); + north.add(saveB); + + JButton execB = new JButton("Exec"); + execB.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Class helloClass; + try { + helloClass = InMemoryJavaCompiler.newInstance().compile("Hello", textArea.getText()); + System.out.println(helloClass.getClass().getName()); + + System.out.println(helloClass.getDeclaredConstructor().newInstance().toString()); + } catch (Exception e1) { + e1.printStackTrace(); + } + + } + }); + north.add(execB); + // JOptionPane.showMessageDialog(null, "test"); + + add(north, BorderLayout.NORTH); + pack(); + setLocationRelativeTo(null); + + + } + + /** + * Create a simple provider that adds some Java-related completions. + */ + private CompletionProvider createCompletionProvider() { + + // A DefaultCompletionProvider is the simplest concrete implementation + // of CompletionProvider. This provider has no understanding of + // language semantics. It simply checks the text entered up to the + // caret position for a match against known completions. This is all + // that is needed in the majority of cases. + DefaultCompletionProvider provider = new DefaultCompletionProvider(); + + // Add completions for all Java keywords. A BasicCompletion is just + // a straightforward word completion. + provider.addCompletion(new BasicCompletion(provider, "abstract")); + provider.addCompletion(new BasicCompletion(provider, "assert")); + provider.addCompletion(new BasicCompletion(provider, "break")); + provider.addCompletion(new BasicCompletion(provider, "case")); + // ... etc ... + provider.addCompletion(new BasicCompletion(provider, "transient")); + provider.addCompletion(new BasicCompletion(provider, "try")); + provider.addCompletion(new BasicCompletion(provider, "void")); + provider.addCompletion(new BasicCompletion(provider, "volatile")); + provider.addCompletion(new BasicCompletion(provider, "while")); + + // Add a couple of "shorthand" completions. These completions don't + // require the input text to be the same thing as the replacement text. + provider.addCompletion(new ShorthandCompletion(provider, "sysout", + "System.out.println(", "System.out.println(")); + provider.addCompletion(new ShorthandCompletion(provider, "syserr", + "System.err.println(", "System.err.println(")); + + return provider; + + } + + public static void main(String[] args) { + // Instantiate GUI on the EDT. + SwingUtilities.invokeLater(() -> { + try { + String laf = UIManager.getSystemLookAndFeelClassName(); + UIManager.setLookAndFeel(laf); + } catch (Exception e) { + /* Never happens */ } + new AutoCompleteDemo().setVisible(true); + }); + } + +} \ No newline at end of file diff --git a/src/main/java/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.java b/src/main/java/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.java new file mode 100644 index 0000000..e2ba144 --- /dev/null +++ b/src/main/java/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.java @@ -0,0 +1,76 @@ +/* + * 12/21/2008 + * + * AutoCompleteDemoApp.java - A demo program for the auto-completion library. + * + * This library is distributed under a modified BSD license. See the included + * LICENSE.md file for details. + */ +package istlab.TestRSyntaxTA.demo; + +import java.awt.Dimension; + +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.WindowConstants; + +import org.fife.ui.autocomplete.CompletionProvider; + + +/** + * A program that demonstrates use of auto-completion. It creates a simple + * C source editor with context sensitive auto-completion. + * + * @author Robert Futrell + * @version 1.0 + */ +public class AutoCompleteDemoApp extends JFrame { + + + /** + * Constructor. + */ + public AutoCompleteDemoApp() { + this(null); + } + + + /** + * Constructor. + * + * @param provider The completion provider for the editor to use. + */ + public AutoCompleteDemoApp(CompletionProvider provider) { + setRootPane(new DemoRootPane(provider)); + setTitle("AutoCompletion Demo"); + setSize(new Dimension(500,600));//pack(); + setLocationRelativeTo(null); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + } + + + /** + * Program entry point. + * + * @param args Command line arguments. + */ + public static void main(String[] args) { + + SwingUtilities.invokeLater(() -> { + String laf = UIManager.getSystemLookAndFeelClassName(); + //laf = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"; + try { + UIManager.setLookAndFeel(laf); + } catch (Exception e) { + e.printStackTrace(); + } + AutoCompleteDemoApp frame = new AutoCompleteDemoApp(); + frame.getToolkit().setDynamicLayout(true); + frame.setVisible(true); + }); + + } + + +} diff --git a/src/main/java/istlab/TestRSyntaxTA/demo/CCellRenderer.java b/src/main/java/istlab/TestRSyntaxTA/demo/CCellRenderer.java new file mode 100644 index 0000000..f129208 --- /dev/null +++ b/src/main/java/istlab/TestRSyntaxTA/demo/CCellRenderer.java @@ -0,0 +1,78 @@ +/* + * 01/07/2009 + * + * CCellRenderer.java - A cell renderer for C completions. + * + * This library is distributed under a modified BSD license. See the included + * LICENSE.md file for details. + */ +package istlab.TestRSyntaxTA.demo; + +import javax.swing.Icon; +import javax.swing.JList; + +import org.fife.ui.autocomplete.Completion; +import org.fife.ui.autocomplete.CompletionCellRenderer; +import org.fife.ui.autocomplete.FunctionCompletion; +import org.fife.ui.autocomplete.VariableCompletion; + + +/** + * The cell renderer used for the C programming language. + * + * @author Robert Futrell + * @version 1.0 + */ +class CCellRenderer extends CompletionCellRenderer { + + private Icon variableIcon; + private Icon functionIcon; + + + /** + * Constructor. + */ + CCellRenderer() { + variableIcon = getIcon("img/var.png"); + functionIcon = getIcon("img/function.png"); + } + + + /** + * {@inheritDoc} + */ + @Override + protected void prepareForOtherCompletion(JList list, + Completion c, int index, boolean selected, boolean hasFocus) { + super.prepareForOtherCompletion(list, c, index, selected, hasFocus); + setIcon(getEmptyIcon()); + } + + + /** + * {@inheritDoc} + */ + @Override + protected void prepareForVariableCompletion(JList list, + VariableCompletion vc, int index, boolean selected, + boolean hasFocus) { + super.prepareForVariableCompletion(list, vc, index, selected, + hasFocus); + setIcon(variableIcon); + } + + + /** + * {@inheritDoc} + */ + @Override + protected void prepareForFunctionCompletion(JList list, + FunctionCompletion fc, int index, boolean selected, + boolean hasFocus) { + super.prepareForFunctionCompletion(list, fc, index, selected, + hasFocus); + setIcon(functionIcon); + } + + +} diff --git a/src/main/java/istlab/TestRSyntaxTA/demo/DemoRootPane.java b/src/main/java/istlab/TestRSyntaxTA/demo/DemoRootPane.java new file mode 100644 index 0000000..4e29539 --- /dev/null +++ b/src/main/java/istlab/TestRSyntaxTA/demo/DemoRootPane.java @@ -0,0 +1,471 @@ +/* + * 01/13/2009 + * + * DemoRootPane.java - Root pane for the demo applet and standalone application. + * + * This library is distributed under a modified BSD license. See the included + * LICENSE.md file for details. + */ +package istlab.TestRSyntaxTA.demo; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.Arrays; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JEditorPane; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JRootPane; +import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; +import javax.swing.text.TextAction; + +import org.fife.ui.autocomplete.AutoCompletion; +import org.fife.ui.autocomplete.BasicCompletion; +import org.fife.ui.autocomplete.CompletionCellRenderer; +import org.fife.ui.autocomplete.CompletionProvider; +import org.fife.ui.autocomplete.DefaultCompletionProvider; +import org.fife.ui.autocomplete.FunctionCompletion; +import org.fife.ui.autocomplete.LanguageAwareCompletionProvider; +import org.fife.ui.autocomplete.ParameterizedCompletion; +import org.fife.ui.autocomplete.ShorthandCompletion; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +import org.fife.ui.rsyntaxtextarea.SyntaxConstants; +import org.fife.ui.rtextarea.RTextScrollPane; +import org.fife.ui.rtextarea.ToolTipSupplier; + + +/** + * The root pane for the demo application. This is all code shared between + * the applet and standalone versions of the demo. + * + * @author Robert Futrell + * @version 1.0 + */ +class DemoRootPane extends JRootPane { + + private RSyntaxTextArea textArea; + private AutoCompletion ac; + private JCheckBoxMenuItem cellRenderingItem; + private JCheckBoxMenuItem alternateRowColorsItem; + private JCheckBoxMenuItem showDescWindowItem; + private JCheckBoxMenuItem paramAssistanceItem; + private JEditorPane ep; + + private static final Color ALT_BG_COLOR = new Color(0xf0f0f0); + + + /** + * Constructor. + */ + DemoRootPane() { + this(null); + } + + + /** + * Constructor. + * + * @param provider The completion provider for the editor to use. + */ + DemoRootPane(CompletionProvider provider) { + + JPanel contentPane = new JPanel(new BorderLayout()); + + ep = new JEditorPane("text/html", null); + updateEditorPane(); // Nimbus doesn't always clean up after itself. + contentPane.add(ep, BorderLayout.NORTH); + + textArea = new RSyntaxTextArea(25, 40); + textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_C); + + if (provider==null) { + provider = createCompletionProvider(); + } + + // Install auto-completion onto our text area. + ac = new AutoCompletion(provider); + ac.setListCellRenderer(new CCellRenderer()); + ac.setShowDescWindow(true); + ac.setParameterAssistanceEnabled(true); + + ac.setAutoCompleteEnabled(true); + ac.setAutoActivationEnabled(true); + ac.setAutoCompleteSingleChoices(true); + ac.setAutoActivationDelay(800); + + ac.install(textArea); + contentPane.add(new RTextScrollPane(textArea, true)); + + try { + textArea.read(new StringReader("int main() {\n printf(\"Hello world\\n\");\n}\n"), null); + } catch (IOException ioe) { + ioe.printStackTrace(); + } + + textArea.setToolTipSupplier((ToolTipSupplier)provider); + ToolTipManager.sharedInstance().registerComponent(textArea); + + setJMenuBar(createMenuBar()); + + // Get ready to go. + setContentPane(contentPane); + + // Put the focus into the text area, not the "label" JEditorPane. + SwingUtilities.invokeLater(() -> textArea.requestFocusInWindow()); + + } + + + /** + * Returns the provider to use when editing code. + * + * @return The provider. + * @see #createCommentCompletionProvider() + * @see #createStringCompletionProvider() + */ + private CompletionProvider createCodeCompletionProvider() { + + // Add completions for the C standard library. + DefaultCompletionProvider cp = new DefaultCompletionProvider(); + + cp.setAutoActivationRules(true, "."); + + // First try loading resource (running from demo jar), then try + // accessing file (debugging in Eclipse). + ClassLoader cl = getClass().getClassLoader(); + InputStream in = cl.getResourceAsStream("c.xml"); + try { + if (in!=null) { + cp.loadFromXML(in); + in.close(); + } + else { + cp.loadFromXML(new File("c.xml")); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + } + + // Add some handy shorthand completions. + cp.addCompletion(new ShorthandCompletion(cp, "main", + "int main(int argc, char **argv)")); + + // Add a parameterized completion with a ton of parameters (see #67) + FunctionCompletion functionCompletionWithLotsOfParameters = new FunctionCompletion(cp, "long", "int"); + functionCompletionWithLotsOfParameters.setParams(Arrays.asList( + new ParameterizedCompletion.Parameter("int", "intVal"), + new ParameterizedCompletion.Parameter("float", "floatVal"), + new ParameterizedCompletion.Parameter("string", "stringVal"), + new ParameterizedCompletion.Parameter("int", "otherVal1"), + new ParameterizedCompletion.Parameter("int", "otherVal2"), + new ParameterizedCompletion.Parameter("int", "otherVal3"), + new ParameterizedCompletion.Parameter("int", "otherVal4"), + new ParameterizedCompletion.Parameter("int", "otherVal5"), + new ParameterizedCompletion.Parameter("int", "otherVal6"), + new ParameterizedCompletion.Parameter("int", "otherVal7"), + new ParameterizedCompletion.Parameter("int", "otherVal8"), + new ParameterizedCompletion.Parameter("int", "otherVal9"), + new ParameterizedCompletion.Parameter("int", "otherVal9"), + new ParameterizedCompletion.Parameter("int", "otherVal10"), + new ParameterizedCompletion.Parameter("int", "otherVal11"), + new ParameterizedCompletion.Parameter("int", "otherVal12"), + new ParameterizedCompletion.Parameter("int", "otherVal13"), + new ParameterizedCompletion.Parameter("int", "otherVal14"), + new ParameterizedCompletion.Parameter("int", "otherVal15"), + new ParameterizedCompletion.Parameter("int", "otherVal16"), + new ParameterizedCompletion.Parameter("int", "otherVal17"), + new ParameterizedCompletion.Parameter("int", "otherVal18"), + new ParameterizedCompletion.Parameter("int", "otherVal19"), + new ParameterizedCompletion.Parameter("int", "otherVal20") + )); + cp.addCompletion(functionCompletionWithLotsOfParameters); + return cp; + + } + + + /** + * Returns the provider to use when in a comment. + * + * @return The provider. + * @see #createCodeCompletionProvider() + * @see #createStringCompletionProvider() + */ + private CompletionProvider createCommentCompletionProvider() { + DefaultCompletionProvider cp = new DefaultCompletionProvider(); + cp.addCompletion(new BasicCompletion(cp, "TODO:", "A to-do reminder")); + cp.addCompletion(new BasicCompletion(cp, "FIXME:", "A bug that needs to be fixed")); + return cp; + } + + + /** + * Creates the completion provider for a C editor. This provider can be + * shared among multiple editors. + * + * @return The provider. + */ + private CompletionProvider createCompletionProvider() { + + // Create the provider used when typing code. + CompletionProvider codeCP = createCodeCompletionProvider(); + + // The provider used when typing a string. + CompletionProvider stringCP = createStringCompletionProvider(); + + // The provider used when typing a comment. + CompletionProvider commentCP = createCommentCompletionProvider(); + + // Create the "parent" completion provider. + LanguageAwareCompletionProvider provider = new + LanguageAwareCompletionProvider(codeCP); + provider.setStringCompletionProvider(stringCP); + provider.setCommentCompletionProvider(commentCP); + + return provider; + + } + + + /** + * Returns the menu bar for the demo application. + * + * @return The menu bar. + */ + private JMenuBar createMenuBar() { + + JMenuBar mb = new JMenuBar(); + + JMenu menu = new JMenu("File"); + Action newAction = new TextAction("New") { + @Override + public void actionPerformed(ActionEvent e) { + AutoCompleteDemoApp app2 = new AutoCompleteDemoApp( + ac.getCompletionProvider()); + app2.setVisible(true); + } + }; + JMenuItem item = new JMenuItem(newAction); + menu.add(item); + mb.add(menu); + + menu = new JMenu("View"); + Action renderAction = new FancyCellRenderingAction(); + cellRenderingItem = new JCheckBoxMenuItem(renderAction); + cellRenderingItem.setSelected(true); + menu.add(cellRenderingItem); + Action alternateRowColorsAction = new AlternateRowColorsAction(); + alternateRowColorsItem = new JCheckBoxMenuItem(alternateRowColorsAction); + menu.add(alternateRowColorsItem); + Action descWindowAction = new ShowDescWindowAction(); + showDescWindowItem = new JCheckBoxMenuItem(descWindowAction); + showDescWindowItem.setSelected(true); + menu.add(showDescWindowItem); + Action paramAssistanceAction = new ParameterAssistanceAction(); + paramAssistanceItem = new JCheckBoxMenuItem(paramAssistanceAction); + paramAssistanceItem.setSelected(true); + menu.add(paramAssistanceItem); + mb.add(menu); + + ButtonGroup bg = new ButtonGroup(); + menu = new JMenu("LookAndFeel"); + Action lafAction = new LafAction("System", UIManager.getSystemLookAndFeelClassName()); + JRadioButtonMenuItem rbmi = new JRadioButtonMenuItem(lafAction); + rbmi.setSelected(true); + menu.add(rbmi); + bg.add(rbmi); + lafAction = new LafAction("Motif", "com.sun.java.swing.plaf.motif.MotifLookAndFeel"); + rbmi = new JRadioButtonMenuItem(lafAction); + menu.add(rbmi); + bg.add(rbmi); + lafAction = new LafAction("Ocean", "javax.swing.plaf.metal.MetalLookAndFeel"); + rbmi = new JRadioButtonMenuItem(lafAction); + menu.add(rbmi); + bg.add(rbmi); + lafAction = new LafAction("Nimbus", "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); + rbmi = new JRadioButtonMenuItem(lafAction); + menu.add(rbmi); + bg.add(rbmi); + mb.add(menu); + + return mb; + + } + + + /** + * Returns the completion provider to use when the caret is in a string. + * + * @return The provider. + * @see #createCodeCompletionProvider() + * @see #createCommentCompletionProvider() + */ + private CompletionProvider createStringCompletionProvider() { + DefaultCompletionProvider cp = new DefaultCompletionProvider(); + cp.addCompletion(new BasicCompletion(cp, "%c", "char", "Prints a character")); + cp.addCompletion(new BasicCompletion(cp, "%i", "signed int", "Prints a signed integer")); + cp.addCompletion(new BasicCompletion(cp, "%f", "float", "Prints a float")); + cp.addCompletion(new BasicCompletion(cp, "%s", "string", "Prints a string")); + cp.addCompletion(new BasicCompletion(cp, "%u", "unsigned int", "Prints an unsigned integer")); + cp.addCompletion(new BasicCompletion(cp, "\\n", "Newline", "Prints a newline")); + return cp; + } + + + /** + * Focuses the text area. + */ + public void focusEditor() { + textArea.requestFocusInWindow(); + } + + + /** + * Updates the font used in the HTML, as well as the background color, of + * the "label" editor pane. The font would always have to be done (since + * HTMLEditorKit doesn't use the editor pane's font by default), but the + * background only has to be modified because Nimbus doesn't clean up the + * colors it installs after itself. + */ + private void updateEditorPane() { + Font f = UIManager.getFont("Label.font"); + String fontTag = ""; + String text = "" + fontTag + "" + + "The text area below provides simple code completion for the C " + + "programming language as you type. Simply type Ctrl+Space " + + "at any time to see a list of completion choices (function names, "+ + "for example). If there is only one possible completion, it will " + + "be automatically inserted.

" + + "Also, completions are context-sensitive. If you type " + + "Ctrl+Space in a comment or in the middle of a string, you will " + + "get different completion choices than if you are in code."; + ep.setText(text); + ep.setBorder(BorderFactory.createEmptyBorder(5,5,10,5)); + ep.setEditable(false); + ep.setBackground(UIManager.getColor("Panel.background")); + } + + + /** + * Toggles whether row backgrounds use alternate colors. + */ + private class AlternateRowColorsAction extends AbstractAction { + + AlternateRowColorsAction() { + putValue(NAME, "Alternate Row Colors in completion list"); + } + + @Override + public void actionPerformed(ActionEvent e) { + boolean alternate = alternateRowColorsItem.isSelected(); + CompletionCellRenderer.setAlternateBackground( + alternate ? ALT_BG_COLOR: null); + } + + } + + + /** + * Toggles whether the completion window uses "fancy" rendering. + */ + private class FancyCellRenderingAction extends AbstractAction { + + FancyCellRenderingAction() { + putValue(NAME, "Fancy Cell Rendering"); + } + + @Override + public void actionPerformed(ActionEvent e) { + boolean fancy = cellRenderingItem.isSelected(); + ac.setListCellRenderer(fancy ? new CCellRenderer() : null); + } + + } + + + /** + * Sets a new look and feel. + */ + private class LafAction extends AbstractAction { + + private String laf; + + LafAction(String name, String laf) { + putValue(NAME, name); + this.laf = laf; + } + + @Override + public void actionPerformed(ActionEvent e) { + try { + UIManager.setLookAndFeel(laf); + } catch (Exception ex) { + JOptionPane.showMessageDialog(DemoRootPane.this, + "Error setting LookAndFeel", "Error", + JOptionPane.ERROR_MESSAGE); + return; + } + Component parent = SwingUtilities.getRoot(DemoRootPane.this); + SwingUtilities.updateComponentTreeUI(parent); + updateEditorPane(); + } + + } + + + /** + * Toggles whether parameter assistance is enabled. + */ + private class ParameterAssistanceAction extends AbstractAction { + + ParameterAssistanceAction() { + putValue(NAME, "Function Parameter Assistance"); + } + + @Override + public void actionPerformed(ActionEvent e) { + boolean enabled = paramAssistanceItem.isSelected(); + ac.setParameterAssistanceEnabled(enabled); + } + + } + + + /** + * Toggles whether the description window is visible. + */ + private class ShowDescWindowAction extends AbstractAction { + + ShowDescWindowAction() { + putValue(NAME, "Show Description Window"); + } + + @Override + public void actionPerformed(ActionEvent e) { + boolean show = showDescWindowItem.isSelected(); + ac.setShowDescWindow(show); + } + + } + + +} diff --git a/src/main/java/istlab/TestRSyntaxTA/demo/package-info.java b/src/main/java/istlab/TestRSyntaxTA/demo/package-info.java new file mode 100644 index 0000000..9badafc --- /dev/null +++ b/src/main/java/istlab/TestRSyntaxTA/demo/package-info.java @@ -0,0 +1,4 @@ +/** + * A package that demonstrates features of the AutoComplete library. + */ +package istlab.TestRSyntaxTA.demo; diff --git a/src/main/java/org/.DS_Store b/src/main/java/org/.DS_Store new file mode 100644 index 0000000..bb868b8 --- /dev/null +++ b/src/main/java/org/.DS_Store Binary files differ diff --git a/src/main/java/org/mdkt/.DS_Store b/src/main/java/org/mdkt/.DS_Store new file mode 100644 index 0000000..973f3e4 --- /dev/null +++ b/src/main/java/org/mdkt/.DS_Store Binary files differ diff --git a/src/main/java/org/mdkt/compiler/CompilationException.java b/src/main/java/org/mdkt/compiler/CompilationException.java new file mode 100644 index 0000000..00c7f7f --- /dev/null +++ b/src/main/java/org/mdkt/compiler/CompilationException.java @@ -0,0 +1,10 @@ +package org.mdkt.compiler; + +public class CompilationException extends RuntimeException { + private static final long serialVersionUID = 5272588827551900536L; + + public CompilationException(String msg) { + super(msg); + } + +} diff --git a/src/main/java/org/mdkt/compiler/CompiledCode.java b/src/main/java/org/mdkt/compiler/CompiledCode.java new file mode 100644 index 0000000..e6715cc --- /dev/null +++ b/src/main/java/org/mdkt/compiler/CompiledCode.java @@ -0,0 +1,33 @@ +package org.mdkt.compiler; + +import javax.tools.SimpleJavaFileObject; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URI; + +/** + * Created by trung on 5/3/15. + */ +public class CompiledCode extends SimpleJavaFileObject { + private ByteArrayOutputStream baos = new ByteArrayOutputStream(); + private String className; + + public CompiledCode(String className) throws Exception { + super(new URI(className), Kind.CLASS); + this.className = className; + } + + public String getClassName() { + return className; + } + + @Override + public OutputStream openOutputStream() throws IOException { + return baos; + } + + public byte[] getByteCode() { + return baos.toByteArray(); + } +} diff --git a/src/main/java/org/mdkt/compiler/DynamicClassLoader.java b/src/main/java/org/mdkt/compiler/DynamicClassLoader.java new file mode 100644 index 0000000..2128bd1 --- /dev/null +++ b/src/main/java/org/mdkt/compiler/DynamicClassLoader.java @@ -0,0 +1,27 @@ +package org.mdkt.compiler; + +import java.util.HashMap; +import java.util.Map; + +public class DynamicClassLoader extends ClassLoader { + + private Map customCompiledCode = new HashMap<>(); + + public DynamicClassLoader(ClassLoader parent) { + super(parent); + } + + public void addCode(CompiledCode cc) { + customCompiledCode.put(cc.getName(), cc); + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + CompiledCode cc = customCompiledCode.get(name); + if (cc == null) { + return super.findClass(name); + } + byte[] byteCode = cc.getByteCode(); + return defineClass(name, byteCode, 0, byteCode.length); + } +} diff --git a/src/main/java/org/mdkt/compiler/ExtendedStandardJavaFileManager.java b/src/main/java/org/mdkt/compiler/ExtendedStandardJavaFileManager.java new file mode 100644 index 0000000..ba98d57 --- /dev/null +++ b/src/main/java/org/mdkt/compiler/ExtendedStandardJavaFileManager.java @@ -0,0 +1,56 @@ +package org.mdkt.compiler; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.tools.FileObject; +import javax.tools.ForwardingJavaFileManager; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; + +/** + * Created by trung on 5/3/15. Edited by turpid-monkey on 9/25/15, completed + * support for multiple compile units. + */ +public class ExtendedStandardJavaFileManager extends + ForwardingJavaFileManager { + + private List compiledCode = new ArrayList(); + private DynamicClassLoader cl; + + /** + * Creates a new instance of ForwardingJavaFileManager. + * + * @param fileManager + * delegate to this file manager + * @param cl + */ + protected ExtendedStandardJavaFileManager(JavaFileManager fileManager, + DynamicClassLoader cl) { + super(fileManager); + this.cl = cl; + } + + @Override + public JavaFileObject getJavaFileForOutput( + JavaFileManager.Location location, String className, + JavaFileObject.Kind kind, FileObject sibling) throws IOException { + + try { + CompiledCode innerClass = new CompiledCode(className); + compiledCode.add(innerClass); + cl.addCode(innerClass); + return innerClass; + } catch (Exception e) { + throw new RuntimeException( + "Error while creating in-memory output file for " + + className, e); + } + } + + @Override + public ClassLoader getClassLoader(JavaFileManager.Location location) { + return cl; + } +} diff --git a/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java b/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java new file mode 100644 index 0000000..b853590 --- /dev/null +++ b/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java @@ -0,0 +1,142 @@ +package org.mdkt.compiler; + +import java.util.*; + +import javax.tools.*; + +/** + * Compile Java sources in-memory + */ +public class InMemoryJavaCompiler { + private JavaCompiler javac; + private DynamicClassLoader classLoader; + private Iterable options; + boolean ignoreWarnings = false; + + private Map sourceCodes = new HashMap(); + + public static InMemoryJavaCompiler newInstance() { + return new InMemoryJavaCompiler(); + } + + private InMemoryJavaCompiler() { + this.javac = ToolProvider.getSystemJavaCompiler(); + this.classLoader = new DynamicClassLoader(ClassLoader.getSystemClassLoader()); + } + + public InMemoryJavaCompiler useParentClassLoader(ClassLoader parent) { + this.classLoader = new DynamicClassLoader(parent); + return this; + } + + /** + * @return the class loader used internally by the compiler + */ + public ClassLoader getClassloader() { + return classLoader; + } + + /** + * Options used by the compiler, e.g. '-Xlint:unchecked'. + * + * @param options + * @return + */ + public InMemoryJavaCompiler useOptions(String... options) { + this.options = Arrays.asList(options); + return this; + } + + /** + * Ignore non-critical compiler output, like unchecked/unsafe operation + * warnings. + * + * @return + */ + public InMemoryJavaCompiler ignoreWarnings() { + ignoreWarnings = true; + return this; + } + + /** + * Compile all sources + * + * @return Map containing instances of all compiled classes + * @throws Exception + */ + public Map> compileAll() throws Exception { + if (sourceCodes.size() == 0) { + throw new CompilationException("No source code to compile"); + } + Collection compilationUnits = sourceCodes.values(); + CompiledCode[] code; + + code = new CompiledCode[compilationUnits.size()]; + Iterator iter = compilationUnits.iterator(); + for (int i = 0; i < code.length; i++) { + code[i] = new CompiledCode(iter.next().getClassName()); + } + DiagnosticCollector collector = new DiagnosticCollector<>(); + ExtendedStandardJavaFileManager fileManager = new ExtendedStandardJavaFileManager(javac.getStandardFileManager(null, null, null), classLoader); + JavaCompiler.CompilationTask task = javac.getTask(null, fileManager, collector, options, null, compilationUnits); + boolean result = task.call(); + if (!result || collector.getDiagnostics().size() > 0) { + StringBuffer exceptionMsg = new StringBuffer(); + exceptionMsg.append("Unable to compile the source"); + boolean hasWarnings = false; + boolean hasErrors = false; + for (Diagnostic d : collector.getDiagnostics()) { + switch (d.getKind()) { + case NOTE: + case MANDATORY_WARNING: + case WARNING: + hasWarnings = true; + break; + case OTHER: + case ERROR: + default: + hasErrors = true; + break; + } + exceptionMsg.append("\n").append("[kind=").append(d.getKind()); + exceptionMsg.append(", ").append("line=").append(d.getLineNumber()); + exceptionMsg.append(", ").append("message=").append(d.getMessage(Locale.US)).append("]"); + } + if (hasWarnings && !ignoreWarnings || hasErrors) { + throw new CompilationException(exceptionMsg.toString()); + } + } + + Map> classes = new HashMap>(); + for (String className : sourceCodes.keySet()) { + classes.put(className, classLoader.loadClass(className)); + } + return classes; + } + + /** + * Compile single source + * + * @param className + * @param sourceCode + * @return + * @throws Exception + */ + public Class compile(String className, String sourceCode) throws Exception { + return addSource(className, sourceCode).compileAll().get(className); + } + + /** + * Add source code to the compiler + * + * @param className + * @param sourceCode + * @return + * @throws Exception + * @see {@link #compileAll()} + */ + public InMemoryJavaCompiler addSource(String className, String sourceCode) throws Exception { + sourceCodes.put(className, new SourceCode(className, sourceCode)); + return this; + } +} diff --git a/src/main/java/org/mdkt/compiler/SourceCode.java b/src/main/java/org/mdkt/compiler/SourceCode.java new file mode 100644 index 0000000..9c7a9e7 --- /dev/null +++ b/src/main/java/org/mdkt/compiler/SourceCode.java @@ -0,0 +1,29 @@ +package org.mdkt.compiler; + +import javax.tools.SimpleJavaFileObject; +import java.io.IOException; +import java.net.URI; + +/** + * Created by trung on 5/3/15. + */ +public class SourceCode extends SimpleJavaFileObject { + private String contents = null; + private String className; + + public SourceCode(String className, String contents) throws Exception { + super(URI.create("string:///" + className.replace('.', '/') + + Kind.SOURCE.extension), Kind.SOURCE); + this.contents = contents; + this.className = className; + } + + public String getClassName() { + return className; + } + + public CharSequence getCharContent(boolean ignoreEncodingErrors) + throws IOException { + return contents; + } +} diff --git a/src/main/res/Hello.java b/src/main/res/Hello.java new file mode 100644 index 0000000..aa4ed8a --- /dev/null +++ b/src/main/res/Hello.java @@ -0,0 +1,8 @@ +import javax.swing.JOptionPane; + +public class Hello { + public String toString() { + JOptionPane.showMessageDialog(null,"これはテストです"); + return "helloMiura"; + } +} \ No newline at end of file diff --git a/src/test/java/istlab/TestRSyntaxTA/AppTest.java b/src/test/java/istlab/TestRSyntaxTA/AppTest.java new file mode 100644 index 0000000..74552ab --- /dev/null +++ b/src/test/java/istlab/TestRSyntaxTA/AppTest.java @@ -0,0 +1,38 @@ +package istlab.TestRSyntaxTA; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/target/RSyntaxTA-1.0-SNAPSHOT-jar-with-dependencies.jar b/target/RSyntaxTA-1.0-SNAPSHOT-jar-with-dependencies.jar new file mode 100644 index 0000000..f471452 --- /dev/null +++ b/target/RSyntaxTA-1.0-SNAPSHOT-jar-with-dependencies.jar Binary files differ diff --git a/target/RSyntaxTA-1.0-SNAPSHOT.jar b/target/RSyntaxTA-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..ffe6dce --- /dev/null +++ b/target/RSyntaxTA-1.0-SNAPSHOT.jar Binary files differ diff --git a/target/classes/.DS_Store b/target/classes/.DS_Store new file mode 100644 index 0000000..18563db --- /dev/null +++ b/target/classes/.DS_Store Binary files differ diff --git a/target/classes/Hello.java b/target/classes/Hello.java new file mode 100644 index 0000000..aa4ed8a --- /dev/null +++ b/target/classes/Hello.java @@ -0,0 +1,8 @@ +import javax.swing.JOptionPane; + +public class Hello { + public String toString() { + JOptionPane.showMessageDialog(null,"これはテストです"); + return "helloMiura"; + } +} \ No newline at end of file diff --git a/target/classes/istlab/TestRSyntaxTA/App.class b/target/classes/istlab/TestRSyntaxTA/App.class new file mode 100644 index 0000000..0e71e02 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/App.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$1.class b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$1.class new file mode 100644 index 0000000..c7ee2e5 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$1.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$2.class b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$2.class new file mode 100644 index 0000000..15147a8 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$2.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$3.class b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$3.class new file mode 100644 index 0000000..471e04f --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo$3.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo.class b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo.class new file mode 100644 index 0000000..bf0486f --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/AutoCompleteDemo.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.class b/target/classes/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.class new file mode 100644 index 0000000..a67a99c --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/CCellRenderer.class b/target/classes/istlab/TestRSyntaxTA/demo/CCellRenderer.class new file mode 100644 index 0000000..235d55d --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/CCellRenderer.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$1.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$1.class new file mode 100644 index 0000000..0f75e5d --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$1.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$AlternateRowColorsAction.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$AlternateRowColorsAction.class new file mode 100644 index 0000000..505a4b6 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$AlternateRowColorsAction.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$FancyCellRenderingAction.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$FancyCellRenderingAction.class new file mode 100644 index 0000000..9adb891 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$FancyCellRenderingAction.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$LafAction.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$LafAction.class new file mode 100644 index 0000000..62b198c --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$LafAction.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$ParameterAssistanceAction.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$ParameterAssistanceAction.class new file mode 100644 index 0000000..e034dc3 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$ParameterAssistanceAction.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$ShowDescWindowAction.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$ShowDescWindowAction.class new file mode 100644 index 0000000..0079a05 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane$ShowDescWindowAction.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane.class b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane.class new file mode 100644 index 0000000..308343d --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/DemoRootPane.class Binary files differ diff --git a/target/classes/istlab/TestRSyntaxTA/demo/package-info.class b/target/classes/istlab/TestRSyntaxTA/demo/package-info.class new file mode 100644 index 0000000..f072c79 --- /dev/null +++ b/target/classes/istlab/TestRSyntaxTA/demo/package-info.class Binary files differ diff --git a/target/classes/org/.DS_Store b/target/classes/org/.DS_Store new file mode 100644 index 0000000..bb868b8 --- /dev/null +++ b/target/classes/org/.DS_Store Binary files differ diff --git a/target/classes/org/mdkt/.DS_Store b/target/classes/org/mdkt/.DS_Store new file mode 100644 index 0000000..973f3e4 --- /dev/null +++ b/target/classes/org/mdkt/.DS_Store Binary files differ diff --git a/target/classes/org/mdkt/compiler/CompilationException.class b/target/classes/org/mdkt/compiler/CompilationException.class new file mode 100644 index 0000000..8916780 --- /dev/null +++ b/target/classes/org/mdkt/compiler/CompilationException.class Binary files differ diff --git a/target/classes/org/mdkt/compiler/CompiledCode.class b/target/classes/org/mdkt/compiler/CompiledCode.class new file mode 100644 index 0000000..e61689a --- /dev/null +++ b/target/classes/org/mdkt/compiler/CompiledCode.class Binary files differ diff --git a/target/classes/org/mdkt/compiler/DynamicClassLoader.class b/target/classes/org/mdkt/compiler/DynamicClassLoader.class new file mode 100644 index 0000000..c466f24 --- /dev/null +++ b/target/classes/org/mdkt/compiler/DynamicClassLoader.class Binary files differ diff --git a/target/classes/org/mdkt/compiler/ExtendedStandardJavaFileManager.class b/target/classes/org/mdkt/compiler/ExtendedStandardJavaFileManager.class new file mode 100644 index 0000000..af63bf9 --- /dev/null +++ b/target/classes/org/mdkt/compiler/ExtendedStandardJavaFileManager.class Binary files differ diff --git a/target/classes/org/mdkt/compiler/InMemoryJavaCompiler$1.class b/target/classes/org/mdkt/compiler/InMemoryJavaCompiler$1.class new file mode 100644 index 0000000..115069c --- /dev/null +++ b/target/classes/org/mdkt/compiler/InMemoryJavaCompiler$1.class Binary files differ diff --git a/target/classes/org/mdkt/compiler/InMemoryJavaCompiler.class b/target/classes/org/mdkt/compiler/InMemoryJavaCompiler.class new file mode 100644 index 0000000..d4845aa --- /dev/null +++ b/target/classes/org/mdkt/compiler/InMemoryJavaCompiler.class Binary files differ diff --git a/target/classes/org/mdkt/compiler/SourceCode.class b/target/classes/org/mdkt/compiler/SourceCode.class new file mode 100644 index 0000000..3af28ac --- /dev/null +++ b/target/classes/org/mdkt/compiler/SourceCode.class Binary files differ diff --git a/target/dependencies.txt b/target/dependencies.txt new file mode 100644 index 0000000..2549139 --- /dev/null +++ b/target/dependencies.txt @@ -0,0 +1,5 @@ +digraph "istlab.TestRSyntaxTA:RSyntaxTA:jar:1.0-SNAPSHOT" { + "istlab.TestRSyntaxTA:RSyntaxTA:jar:1.0-SNAPSHOT" -> "com.fifesoft:autocomplete:jar:3.2.0:compile" ; + "istlab.TestRSyntaxTA:RSyntaxTA:jar:1.0-SNAPSHOT" -> "junit:junit:jar:3.8.1:test" ; + "com.fifesoft:autocomplete:jar:3.2.0:compile" -> "com.fifesoft:rsyntaxtextarea:jar:3.2.0:compile" ; + } \ No newline at end of file diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..41078e8 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Tue Aug 30 09:37:05 JST 2022 +artifactId=RSyntaxTA +groupId=istlab.TestRSyntaxTA +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..b467065 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +org/mdkt/compiler/InMemoryJavaCompiler$1.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..34c59e2 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,12 @@ +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/istlab/TestRSyntaxTA/demo/AutoCompleteDemoApp.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/istlab/TestRSyntaxTA/demo/DemoRootPane.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/org/mdkt/compiler/DynamicClassLoader.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/org/mdkt/compiler/ExtendedStandardJavaFileManager.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/org/mdkt/compiler/CompiledCode.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/istlab/TestRSyntaxTA/demo/CCellRenderer.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/org/mdkt/compiler/CompilationException.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/istlab/TestRSyntaxTA/demo/package-info.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/istlab/TestRSyntaxTA/App.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/istlab/TestRSyntaxTA/AutoCompleteDemo.java +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/main/java/org/mdkt/compiler/SourceCode.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..70f8368 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +/Users/miura/Nextcloud/binsh/Java/Maven/RSyntaxTA/src/test/java/istlab/TestRSyntaxTA/AppTest.java diff --git a/target/surefire-reports/TEST-istlab.TestRSyntaxTA.AppTest.xml b/target/surefire-reports/TEST-istlab.TestRSyntaxTA.AppTest.xml new file mode 100644 index 0000000..75a3789 --- /dev/null +++ b/target/surefire-reports/TEST-istlab.TestRSyntaxTA.AppTest.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/istlab.TestRSyntaxTA.AppTest.txt b/target/surefire-reports/istlab.TestRSyntaxTA.AppTest.txt new file mode 100644 index 0000000..f4327d4 --- /dev/null +++ b/target/surefire-reports/istlab.TestRSyntaxTA.AppTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: istlab.TestRSyntaxTA.AppTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec diff --git a/target/test-classes/istlab/TestRSyntaxTA/AppTest.class b/target/test-classes/istlab/TestRSyntaxTA/AppTest.class new file mode 100644 index 0000000..245effb --- /dev/null +++ b/target/test-classes/istlab/TestRSyntaxTA/AppTest.class Binary files differ