From c0accff404c1e3a9c2f7eddb2fb785dc2da2af07 Mon Sep 17 00:00:00 2001 From: skylarmt Date: Wed, 25 Mar 2015 20:46:54 -0600 Subject: [PATCH] Plugin system fully integrated --- src/net/apocalypselabs/symat/Editor.form | 25 +- src/net/apocalypselabs/symat/Editor.java | 11 +- .../apocalypselabs/symat/InstallPlugin.form | 198 ++++++++++++ .../apocalypselabs/symat/InstallPlugin.java | 299 ++++++++++++++++++ src/net/apocalypselabs/symat/Main.java | 45 ++- .../apocalypselabs/symat/PackagePlugin.form | 3 + .../apocalypselabs/symat/PackagePlugin.java | 1 + .../symat/SingleInstanceServer.java | 2 + .../apocalypselabs/symat/icons/plugins.png | Bin 0 -> 564 bytes .../symat/images/installplugin.png | Bin 0 -> 4880 bytes .../symat/plugin/LoadPlugin.java | 4 + 11 files changed, 577 insertions(+), 11 deletions(-) create mode 100644 src/net/apocalypselabs/symat/InstallPlugin.form create mode 100644 src/net/apocalypselabs/symat/InstallPlugin.java create mode 100644 src/net/apocalypselabs/symat/icons/plugins.png create mode 100644 src/net/apocalypselabs/symat/images/installplugin.png diff --git a/src/net/apocalypselabs/symat/Editor.form b/src/net/apocalypselabs/symat/Editor.form index 9312f49..403606e 100644 --- a/src/net/apocalypselabs/symat/Editor.form +++ b/src/net/apocalypselabs/symat/Editor.form @@ -52,6 +52,9 @@ + + + @@ -60,6 +63,9 @@ + + + @@ -101,7 +107,7 @@ - + @@ -109,7 +115,10 @@ - + + + + @@ -119,6 +128,9 @@ + + + @@ -127,6 +139,9 @@ + + + @@ -223,6 +238,9 @@ + + + @@ -235,6 +253,9 @@ + + + diff --git a/src/net/apocalypselabs/symat/Editor.java b/src/net/apocalypselabs/symat/Editor.java index d4fa762..4919965 100644 --- a/src/net/apocalypselabs/symat/Editor.java +++ b/src/net/apocalypselabs/symat/Editor.java @@ -348,6 +348,7 @@ public class Editor extends javax.swing.JInternalFrame { openSampleBtn.setText("Open Code Sample"); + sampleHelloWorld.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); sampleHelloWorld.setText("helloworld"); sampleHelloWorld.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -356,6 +357,7 @@ public class Editor extends javax.swing.JInternalFrame { }); openSampleBtn.add(sampleHelloWorld); + sampleGraph.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); sampleGraph.setText("graph"); sampleGraph.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -388,7 +390,7 @@ public class Editor extends javax.swing.JInternalFrame { jMenu1.setToolTipText(""); exportMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK)); - exportMenu.setText("Export Code"); + exportMenu.setText("Export code"); exportMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exportMenuActionPerformed(evt); @@ -396,7 +398,8 @@ public class Editor extends javax.swing.JInternalFrame { }); jMenu1.add(exportMenu); - packPluginMenu.setText("Package Plugin..."); + packPluginMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); + packPluginMenu.setText("Package as plugin"); packPluginMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { packPluginMenuActionPerformed(evt); @@ -406,6 +409,7 @@ public class Editor extends javax.swing.JInternalFrame { fileMenu.add(jMenu1); + shareMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK)); shareMenu.setText("Share..."); shareMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -414,6 +418,7 @@ public class Editor extends javax.swing.JInternalFrame { }); fileMenu.add(shareMenu); + shareAsMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); shareAsMenu.setText("Share as..."); shareAsMenu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -488,6 +493,7 @@ public class Editor extends javax.swing.JInternalFrame { codeLangMenu.setText("Language"); + javascriptOption.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_J, java.awt.event.InputEvent.CTRL_MASK)); langBtnGroup.add(javascriptOption); javascriptOption.setSelected(true); javascriptOption.setText("Javascript"); @@ -498,6 +504,7 @@ public class Editor extends javax.swing.JInternalFrame { }); codeLangMenu.add(javascriptOption); + pythonOption.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); langBtnGroup.add(pythonOption); pythonOption.setText("Python"); pythonOption.addActionListener(new java.awt.event.ActionListener() { diff --git a/src/net/apocalypselabs/symat/InstallPlugin.form b/src/net/apocalypselabs/symat/InstallPlugin.form new file mode 100644 index 0000000..d97026b --- /dev/null +++ b/src/net/apocalypselabs/symat/InstallPlugin.form @@ -0,0 +1,198 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/net/apocalypselabs/symat/InstallPlugin.java b/src/net/apocalypselabs/symat/InstallPlugin.java new file mode 100644 index 0000000..cbe883e --- /dev/null +++ b/src/net/apocalypselabs/symat/InstallPlugin.java @@ -0,0 +1,299 @@ +/* + * CODE LICENSE ===================== + * Copyright (c) 2015, Apocalypse Laboratories + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * 4. You adhere to the Media License detailed below. If you do not, this license + * is automatically revoked and you must purge all copies of the software you + * possess, in source or binary form. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * MEDIA LICENSE ==================== + * All images and other graphical files (the "graphics") included with this + * software are copyright (c) 2015 Apocalypse Laboratories. You may not distribute + * the graphics or any program, source code repository, or other digital storage + * media containing them without written permission from Apocalypse Laboratories. + * This ban on distribution only applies to publicly available systems. + * A password-protected network file share, USB drive, or other storage scheme that + * cannot be easily accessed by the public is generally allowed. If in doubt, + * contact Apocalypse Laboratories. If Apocalypse Laboratories allows or denies + * you permission, that decision is considered final and binding. + */ +package net.apocalypselabs.symat; + +import java.io.File; +import java.io.IOException; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.filechooser.FileNameExtensionFilter; +import net.apocalypselabs.symat.plugin.LoadPlugin; +import net.apocalypselabs.symat.plugin.Plugin; +import org.python.google.common.io.Files; + +/** + * + * @author Skylar + */ +public class InstallPlugin extends javax.swing.JInternalFrame { + + private final JFileChooser fc = new JFileChooser(); + + private File f = null; + + /** + * Creates new form InstallPlugin + */ + public InstallPlugin() { + fc.setFileFilter(new FileNameExtensionFilter( + "Plugin (sypl)", + "sypl")); + initComponents(); + } + + public InstallPlugin(File f) { + this(); + openPlugin(f); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + pluginName = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + author = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + website = new javax.swing.JTextField(); + version = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + shortDesc = new javax.swing.JTextField(); + jLabel7 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + longDesc = new javax.swing.JTextArea(); + openPluginBtn = new javax.swing.JButton(); + iconBox = new javax.swing.JLabel(); + installBtn = new javax.swing.JButton(); + + setClosable(true); + setIconifiable(true); + setTitle("Install Plugin"); + setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/plugins.png"))); // NOI18N + + jLabel1.setText("Plugin Name:"); + + pluginName.setEditable(false); + + jLabel4.setText("Author:"); + + author.setEditable(false); + + jLabel3.setText("Website:"); + + website.setEditable(false); + + version.setEditable(false); + + jLabel5.setText("Version:"); + + jLabel6.setText("Description:"); + + shortDesc.setEditable(false); + + jLabel7.setText("Long Description:"); + + longDesc.setEditable(false); + longDesc.setColumns(20); + longDesc.setRows(5); + jScrollPane1.setViewportView(longDesc); + + openPluginBtn.setText("Open Plugin"); + openPluginBtn.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openPluginBtnActionPerformed(evt); + } + }); + + iconBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + + installBtn.setText("Install Plugin"); + installBtn.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + installBtnActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addGroup(layout.createSequentialGroup() + .addComponent(openPluginBtn) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(iconBox, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(installBtn)) + .addComponent(jScrollPane1)) + .addComponent(jLabel7) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(website) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(version)) + .addGroup(layout.createSequentialGroup() + .addComponent(pluginName) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(author)) + .addComponent(shortDesc, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(openPluginBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(iconBox, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(installBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(pluginName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4) + .addComponent(author, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(website, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5) + .addComponent(version, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(shortDesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void openPluginBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openPluginBtnActionPerformed + int result = fc.showDialog(this, "Open Plugin"); + if (result == JFileChooser.APPROVE_OPTION) { + openPlugin(fc.getSelectedFile()); + } + }//GEN-LAST:event_openPluginBtnActionPerformed + + private void openPlugin(File file) { + try { + Plugin p = (new LoadPlugin(file)).getPlugin(); + pluginName.setText(p.getTitle()); + shortDesc.setText(p.getLongTitle()); + version.setText(p.getVersion()); + longDesc.setText(p.getDesc()); + website.setText(p.getWebsite()); + author.setText(p.getAuthor()); + iconBox.setIcon(p.getIcon()); + f = file; + } catch (Exception ex) { + Debug.stacktrace(ex); + JOptionPane.showInternalMessageDialog(this, + "Error opening plugin.\n\n" + ex.getMessage()); + } + } + + private void installBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_installBtnActionPerformed + if (f == null) { + return; + } + try { + Files.copy(f, + new File( + System.getProperty("user.home") + + "\\.symat\\plugins\\" + + f.getName())); + Main.maingui.reloadRibbon(); + JOptionPane.showInternalMessageDialog(this, + "Plugin installed!", + "Success", + JOptionPane.PLAIN_MESSAGE); + } catch (IOException ex) { + Debug.stacktrace(ex); + JOptionPane.showInternalMessageDialog(this, + "Error: could not copy plugin file: " + ex.getMessage(), + "Error", + JOptionPane.ERROR_MESSAGE); + } catch (Exception ex) { + Debug.stacktrace(ex); + JOptionPane.showInternalMessageDialog(this, + "Error: could not install plugin file." + + "Try restarting SyMAT.\n" + + ex.getMessage(), + "Error", + JOptionPane.ERROR_MESSAGE); + } + }//GEN-LAST:event_installBtnActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField author; + private javax.swing.JLabel iconBox; + private javax.swing.JButton installBtn; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea longDesc; + private javax.swing.JButton openPluginBtn; + private javax.swing.JTextField pluginName; + private javax.swing.JTextField shortDesc; + private javax.swing.JTextField version; + private javax.swing.JTextField website; + // End of variables declaration//GEN-END:variables +} diff --git a/src/net/apocalypselabs/symat/Main.java b/src/net/apocalypselabs/symat/Main.java index a995c43..e9fabf3 100644 --- a/src/net/apocalypselabs/symat/Main.java +++ b/src/net/apocalypselabs/symat/Main.java @@ -147,7 +147,7 @@ public class Main extends JRibbonFrame { public static Main maingui; - JRibbonBand pluginband = new JRibbonBand("Plugins", null); + public JRibbonBand pluginband; /** * Creates the main app window and does some quick things that aren't @@ -190,6 +190,8 @@ public class Main extends JRibbonFrame { Tasks tt = new Tasks(new File(argfile)); loadFrame(tt); argfile = ""; + } else if (argfile.endsWith(".sypl")) { + loadFrame(new InstallPlugin(new File(argfile))); } else { Editor ed = new Editor(); loadFrame(ed); @@ -273,6 +275,9 @@ public class Main extends JRibbonFrame { * Load plugins from disk. */ public void loadPlugins() { + pluginband = new JRibbonBand("Plugins", null); + pluginband.setResizePolicies((List) Arrays.asList( + new IconRibbonBandResizePolicy(pluginband.getControlPanel()))); File dir = new File(System.getProperty("user.home") + "\\.symat\\plugins"); dir.mkdirs(); File[] files = dir.listFiles(new FilenameFilter() { @@ -285,14 +290,24 @@ public class Main extends JRibbonFrame { for (File pl : files) { try { LoadPlugin lp = new LoadPlugin(pl); + JCommandButton b = lp.getRibbonBtn(); pluginband.addCommandButton( - lp.getRibbonBtn(), + b, RibbonElementPriority.MEDIUM); + b.setVisible(true); } catch (Exception ex) { } } } + + /** + * Reload the Ribbon tabs and all sub-components. + */ + public void reloadRibbon() { + getRibbon().removeAllTasks(); + loadRibbon(); + } /** * Load the ribbon in all its glory. @@ -306,6 +321,7 @@ public class Main extends JRibbonFrame { JRibbonBand appsband = new JRibbonBand("Apps", null); JRibbonBand webband = new JRibbonBand("Community", null); JRibbonBand collabband = new JRibbonBand("Team", null); + JRibbonBand getpluginband = new JRibbonBand("Install", null); loadPlugins(); shellbtn.addActionListener(new ActionListener() { @@ -360,6 +376,12 @@ public class Main extends JRibbonFrame { loadFrame(new Tasks()); } }); + installpluginbtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + loadFrame(new InstallPlugin()); + } + }); shellbtn.setActionRichTooltip(new RichTooltip("Command Shell", "Open a window for running interactive commands.")); @@ -377,6 +399,8 @@ public class Main extends JRibbonFrame { "Collaborate over the Internet on projects.")); tasksbtn.setActionRichTooltip(new RichTooltip("Task List", "Manage tasks and to-do lists for projects.")); + installpluginbtn.setActionRichTooltip(new RichTooltip("Install Plugin", + "Install a plugin from a file and view plugin info.")); coreband.addCommandButton(shellbtn, RibbonElementPriority.TOP); coreband.addCommandButton(editorbtn, RibbonElementPriority.TOP); @@ -389,6 +413,8 @@ public class Main extends JRibbonFrame { collabband.addCommandButton(padsbtn, RibbonElementPriority.MEDIUM); collabband.addCommandButton(tasksbtn, RibbonElementPriority.MEDIUM); + + getpluginband.addCommandButton(installpluginbtn, RibbonElementPriority.MEDIUM); coreband.setResizePolicies((List) Arrays.asList( new CoreRibbonResizePolicies.None(coreband.getControlPanel()), @@ -397,18 +423,21 @@ public class Main extends JRibbonFrame { new CoreRibbonResizePolicies.None(appsband.getControlPanel()), new IconRibbonBandResizePolicy(appsband.getControlPanel()))); webband.setResizePolicies((List) Arrays.asList( - new CoreRibbonResizePolicies.None(appsband.getControlPanel()), - new IconRibbonBandResizePolicy(appsband.getControlPanel()))); + new CoreRibbonResizePolicies.None(webband.getControlPanel()), + new IconRibbonBandResizePolicy(webband.getControlPanel()))); collabband.setResizePolicies((List) Arrays.asList( + new CoreRibbonResizePolicies.None(collabband.getControlPanel()), + new IconRibbonBandResizePolicy(collabband.getControlPanel()))); + getpluginband.setResizePolicies((List) Arrays.asList( new CoreRibbonResizePolicies.None(appsband.getControlPanel()), - new IconRibbonBandResizePolicy(appsband.getControlPanel()))); + new IconRibbonBandResizePolicy(pluginband.getControlPanel()))); pluginband.setResizePolicies((List) Arrays.asList( new CoreRibbonResizePolicies.None(appsband.getControlPanel()), - new IconRibbonBandResizePolicy(appsband.getControlPanel()))); + new IconRibbonBandResizePolicy(pluginband.getControlPanel()))); RibbonTask hometask = new RibbonTask("Home", coreband, appsband); RibbonTask webtask = new RibbonTask("Tools", webband, collabband); - RibbonTask plugintask = new RibbonTask("Plugins", pluginband); + RibbonTask plugintask = new RibbonTask("Plugins", getpluginband, pluginband); loadRibbonMenu(null); @@ -1059,6 +1088,8 @@ public class Main extends JRibbonFrame { = new JCommandButton("Pads", getRibbonIcon("pads")); public static JCommandButton tasksbtn = new JCommandButton("Tasks", getRibbonIcon("tasks")); + public static JCommandButton installpluginbtn + = new JCommandButton("Install", getRibbonIcon("installplugin")); public static RibbonApplicationMenuEntryPrimary openbtn; // Variables declaration - do not modify//GEN-BEGIN:variables diff --git a/src/net/apocalypselabs/symat/PackagePlugin.form b/src/net/apocalypselabs/symat/PackagePlugin.form index 6c994f4..ebd0008 100644 --- a/src/net/apocalypselabs/symat/PackagePlugin.form +++ b/src/net/apocalypselabs/symat/PackagePlugin.form @@ -5,6 +5,9 @@ + + +
diff --git a/src/net/apocalypselabs/symat/PackagePlugin.java b/src/net/apocalypselabs/symat/PackagePlugin.java index 3955f4b..48ebd5d 100644 --- a/src/net/apocalypselabs/symat/PackagePlugin.java +++ b/src/net/apocalypselabs/symat/PackagePlugin.java @@ -137,6 +137,7 @@ public class PackagePlugin extends javax.swing.JInternalFrame { setClosable(true); setIconifiable(true); setTitle("Package Plugin"); + setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/plugins.png"))); // NOI18N jLabel1.setText("Plugin Name:"); diff --git a/src/net/apocalypselabs/symat/SingleInstanceServer.java b/src/net/apocalypselabs/symat/SingleInstanceServer.java index 83ecd00..2938e26 100644 --- a/src/net/apocalypselabs/symat/SingleInstanceServer.java +++ b/src/net/apocalypselabs/symat/SingleInstanceServer.java @@ -68,6 +68,8 @@ public class SingleInstanceServer extends NanoHTTPD { if (parms.get("arg").endsWith(".sytt")) { Tasks tt = new Tasks(new File(parms.get("arg"))); Main.loadFrame(tt); + } else if (parms.get("arg").endsWith(".sypl")) { + Main.loadFrame(new InstallPlugin(new File(parms.get("arg")))); } else { Editor ed = new Editor(); Main.loadFrame(ed); diff --git a/src/net/apocalypselabs/symat/icons/plugins.png b/src/net/apocalypselabs/symat/icons/plugins.png new file mode 100644 index 0000000000000000000000000000000000000000..1ce6859599867048eac42d80cf7736717b80187f GIT binary patch literal 564 zcmV-40?Yl0P)-{G9^ zJwNWbPk@02lUZ|9K*RR@B)m(iPYr1x4{QNSppUkXV(rvz6DvR-s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