-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c7256c
commit 8001610
Showing
30 changed files
with
1,485 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path=""/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/libs"/> | ||
<classpathentry kind="output" path="bin"/> | ||
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Logisim-Fork/src/main/java/com/cburch/logisim/gui/plugin/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/PluginFrame.class | ||
/PluginFrame$MyListener.class | ||
/PluginFrame$WindowMenuManager.class | ||
/Strings.class | ||
/IntlOptions$RestrictedLabel.class | ||
/IntlOptions.class | ||
/OptionsPanel.class | ||
/PrefBoolean.class | ||
/PrefOptionList.class | ||
/PrefOption.class | ||
/ForkOptions$MyListener.class | ||
/ForkOptions.class | ||
/IntlOptions$1.class | ||
/PluginOptions$MyListener.class | ||
/PluginOptions.class | ||
/StoreOptions$1.class | ||
/StoreOptions.class | ||
/P.class | ||
/Installed$1.class | ||
/Installed.class | ||
/InstalledOptions$1.class | ||
/InstalledOptions.class | ||
/InstalledOptions$MyListener.class | ||
/MyListener.class | ||
/StoreOptions$MyListener.class |
107 changes: 107 additions & 0 deletions
107
Logisim-Fork/src/main/java/com/cburch/logisim/gui/plugin/InstalledOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* Copyright (c) 2010, Carl Burch. License information is located in the | ||
* com.cburch.logisim.Main source code and at www.cburch.com/logisim/. */ | ||
|
||
package com.cburch.logisim.gui.plugin; | ||
|
||
|
||
|
||
import java.awt.Dimension; | ||
import java.awt.Font; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.util.Vector; | ||
|
||
|
||
import javax.swing.JButton; | ||
import javax.swing.JPanel; | ||
import javax.swing.JScrollPane; | ||
import javax.swing.JTable; | ||
import javax.swing.table.DefaultTableModel; | ||
|
||
import com.cburch.logisim.plugin.Json; | ||
import com.cburch.logisim.plugin.PluginUtils; | ||
|
||
class InstalledOptions extends OptionsPanel { | ||
private static final long serialVersionUID = -6484141255871285744L; | ||
private class MyListener implements ActionListener { | ||
@Override | ||
public void actionPerformed(ActionEvent event) { | ||
Object src = event.getSource(); | ||
if (src == pluginDeleteButton) { | ||
int[] selectedRows = table.getSelectedRows(); | ||
for (int i = selectedRows.length-1; i >=0; i--) { | ||
int row = selectedRows[i]; | ||
String pluginName =table.getValueAt(row, 0).toString()+"-"+table.getValueAt(row, 1)+"."+table.getValueAt(row, 2); | ||
PluginUtils.deleteFile(pluginName); | ||
((DefaultTableModel)table.getModel()).removeRow(row); | ||
} | ||
PluginUtils.requestRestart(); | ||
} | ||
else if (src == pluginUpdateButton) { | ||
int[] selectedRows = table.getSelectedRows(); | ||
boolean isUpdated=false; | ||
for (int i = selectedRows.length-1; i >=0; i--) { | ||
int row = selectedRows[i]; | ||
String pluginName =table.getValueAt(row, 0).toString()+"-"+table.getValueAt(row, 1)+"."+table.getValueAt(row, 2); | ||
if (Json.searchUpdatedVersion(pluginName)) { | ||
isUpdated=(true); | ||
} | ||
if (isUpdated) { | ||
PluginUtils.requestRestart(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
private MyListener myListener = new MyListener(); | ||
|
||
private JButton pluginDeleteButton = new JButton(Strings.get("pluginDeleteButton")); | ||
private JButton pluginUpdateButton = new JButton(Strings.get("pluginUpdateButton")); | ||
|
||
JTable table; | ||
public InstalledOptions(PluginFrame frame) { | ||
super(frame); | ||
pluginDeleteButton.addActionListener(myListener); | ||
pluginUpdateButton.addActionListener(myListener); | ||
Vector<Vector<String>> rec = PluginUtils.getInstallTable(); | ||
Vector<String> columnNames = new Vector<String>(); | ||
columnNames.addElement(Strings.get("tableName")); | ||
columnNames.addElement(Strings.get("tableVersion")); | ||
columnNames.addElement(Strings.get("tableType")); | ||
table = new JTable(rec, columnNames){ | ||
private static final long serialVersionUID = -9199865726557261219L; | ||
public boolean isCellEditable(int row, int column) { | ||
return false; | ||
} | ||
}; | ||
; | ||
|
||
JPanel panel = new JPanel(); | ||
if(table.getRowCount()==0) { | ||
pluginDeleteButton.setEnabled(false); | ||
pluginUpdateButton.setEnabled(false); | ||
} | ||
panel.add(pluginDeleteButton); | ||
panel.add(pluginUpdateButton); | ||
table.setFont(new Font("Arial", Font.CENTER_BASELINE, 15)); | ||
table.setRowHeight(25); | ||
JScrollPane scrollPane=new JScrollPane(table); | ||
Dimension d = new Dimension(400,200); | ||
scrollPane.setPreferredSize(d); | ||
table.getColumnModel().getColumn(0).setPreferredWidth(300); | ||
add(panel); | ||
add(scrollPane); | ||
} | ||
|
||
|
||
@Override | ||
public String getHelpText() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getTitle() { | ||
return Strings.get("installedTitle"); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
Logisim-Fork/src/main/java/com/cburch/logisim/gui/plugin/OptionsPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* Copyright (c) 2010, Carl Burch. License information is located in the | ||
* com.cburch.logisim.Main source code and at www.cburch.com/logisim/. */ | ||
|
||
package com.cburch.logisim.gui.plugin; | ||
|
||
import java.awt.LayoutManager; | ||
|
||
import javax.swing.JPanel; | ||
|
||
abstract class OptionsPanel extends JPanel { | ||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = -2637847947425197542L; | ||
private PluginFrame optionsFrame; | ||
|
||
public OptionsPanel(PluginFrame frame) { | ||
super(); | ||
this.optionsFrame = frame; | ||
} | ||
|
||
public OptionsPanel(PluginFrame frame, LayoutManager manager) { | ||
super(manager); | ||
this.optionsFrame = frame; | ||
} | ||
|
||
public abstract String getHelpText(); | ||
|
||
PluginFrame getPreferencesFrame() { | ||
return optionsFrame; | ||
} | ||
|
||
public abstract String getTitle(); | ||
} |
Oops, something went wrong.