Skip to content

Commit

Permalink
Merge pull request #189 from grthor/euclid
Browse files Browse the repository at this point in the history
Replaced actions with commands
  • Loading branch information
Thorben Groos authored Sep 25, 2018
2 parents e8a9195 + abce206 commit f345095
Show file tree
Hide file tree
Showing 12 changed files with 1,434 additions and 1,099 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public void dispose() {

}

@SuppressWarnings("rawtypes")
@Override
public Map getCurrentState() {

Expand Down
5 changes: 4 additions & 1 deletion org.jcryptool.visual.euclid/OSGI-INF/l10n/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ Bundle-Vendor = jcryptool.org, by Felix Eckardt, Merlin de la Haye
Bundle-Name = Extended Euclidean / Reciprocal Subtraction Plug-in
view.name = Extended Euclidean / Reciprocal Subtraction
Visual.name = Extended Euclidean / Reciprocal Subtraction
restart.command.name = Restart
restart.command.name = Restart
restart.command.csvexport = Export to CSV
restart.command.pdfexport = Export to PDF
restart.command.texexport = Export to Tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ Bundle-Vendor = jcryptool.org, von Felix Eckardt, Merlin de la Haye
Bundle-Name = Extended Euclidean / Alternating Removal Plug-in
view.name = Erweiterter Euklid / Wechselwegnahme
Visual.name = Erweiterter Euklid / Wechselwegnahme
restart.command.name = Neustart
restart.command.name = Neustart
restart.command.csvexport = Exportieren als CSV
restart.command.pdfexport = Exportieren als PDF
restart.command.texexport = Exportieren als Tex
110 changes: 110 additions & 0 deletions org.jcryptool.visual.euclid/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,115 @@
file="$nl$/help/contexts.xml">
</contexts>
</extension>

<extension
point="org.eclipse.ui.handlers">
<handler
class="org.jcryptool.visual.euclid.handler.RestartHandler"
commandId="org.jcryptool.visual.euclid.restartCommand">
</handler>
<handler
class="org.jcryptool.visual.euclid.handler.ExportToCSVHandler"
commandId="org.jcryptool.visual.euclid.CSVexportCommand">
<activeWhen>
<with
variable="org.jcryptool.visual.euclid.commands.CsvState">
<equals
value="ENABLED">
</equals>
</with>
</activeWhen>
</handler>
<handler
class="org.jcryptool.visual.euclid.handler.ExportToPDFHandler"
commandId="org.jcryptool.visual.euclid.PDFexportCommand">
<activeWhen>
<with
variable="org.jcryptool.visual.euclid.commands.PdfState">
<equals
value="ENABLED">
</equals>
</with>
</activeWhen>
</handler>
<handler
class="org.jcryptool.visual.euclid.handler.ExportToTEXHandler"
commandId="org.jcryptool.visual.euclid.TEXexportCommand">
<activeWhen>
<with
variable="org.jcryptool.visual.euclid.commands.TexState">
<equals
value="ENABLED">
</equals>
</with>
</activeWhen>
</handler>

</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="org.jcryptool.visual.euclid.restartCommand"
name="%restart.command.name">
</command>
<command
id="org.jcryptool.visual.euclid.CSVexportCommand"
name="%restart.command.csvexport">
</command>
<command
id="org.jcryptool.visual.euclid.PDFexportCommand"
name="%restart.command.pdfexport">
</command>
<command
id="org.jcryptool.visual.euclid.TEXexportCommand"
name="%restart.command.texexport">
</command>
</extension>

<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:org.jcryptool.visual.euclid.view">
<command
commandId="org.jcryptool.visual.euclid.restartCommand"
icon="/icons/view.gif"
style="push">
</command>
</menuContribution>
<menuContribution
locationURI="menu:org.jcryptool.visual.euclid.view">
<command
commandId="org.jcryptool.visual.euclid.CSVexportCommand"
style="push">
</command>
<command
commandId="org.jcryptool.visual.euclid.PDFexportCommand"
style="push">
</command>
<command
commandId="org.jcryptool.visual.euclid.TEXexportCommand"
style="push">
</command>
</menuContribution>
</extension>

<extension
point="org.eclipse.ui.services">
<sourceProvider
provider="org.jcryptool.visual.euclid.handler.CommandState">
<variable
name="org.jcryptool.visual.euclid.commands.CsvState"
priorityLevel="workbench">
</variable>
<variable
name="org.jcryptool.visual.euclid.commands.PsvState"
priorityLevel="workbench">
</variable>
<variable
name="org.jcryptool.visual.euclid.commands.TexState"
priorityLevel="workbench">
</variable>
</sourceProvider>
</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public void exportToPDF() {

for (int i=0; i<size; i++) {
table.addCell(new Phrase(euclid[i]));
System.out.println("3 "+i);
}

document.add(new Paragraph("Extended Euclidian"));
Expand Down
Loading

0 comments on commit f345095

Please sign in to comment.