-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from danstooamerican/bluej5-update
Bluej5 update
- Loading branch information
Showing
7 changed files
with
39 additions
and
52 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
# Package Files # | ||
*.jar | ||
!bluejext2.jar | ||
*.war | ||
*.ear | ||
|
||
|
Binary file not shown.
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
42 changes: 15 additions & 27 deletions
42
src/main/java/class_diagram_editor/bluej_adapters/menu/BlueJMenuGenerator.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 |
---|---|---|
@@ -1,47 +1,35 @@ | ||
package class_diagram_editor.bluej_adapters.menu; | ||
|
||
import bluej.extensions.BPackage; | ||
import bluej.extensions.BProject; | ||
import bluej.extensions.MenuGenerator; | ||
import bluej.extensions.ProjectNotOpenException; | ||
import bluej.extensions2.BPackage; | ||
import bluej.extensions2.BProject; | ||
import bluej.extensions2.MenuGenerator; | ||
import bluej.extensions2.ProjectNotOpenException; | ||
import class_diagram_editor.ClassEditorApplication; | ||
import class_diagram_editor.bluej_adapters.source_control.SourceControl; | ||
import class_diagram_editor.bluej_adapters.source_control.SourceCodeControl; | ||
|
||
import javax.swing.AbstractAction; | ||
import javax.swing.JMenuItem; | ||
import java.awt.event.ActionEvent; | ||
import javafx.scene.control.MenuItem; | ||
|
||
/** | ||
* Adds extra JMenu entries which belong to the {@link class_diagram_editor.bluej_adapters.BlueJExtension extension}. | ||
*/ | ||
public class BlueJMenuGenerator extends MenuGenerator { | ||
|
||
@Override | ||
public JMenuItem getToolsMenuItem(BPackage bp) { | ||
public MenuItem getToolsMenuItem(BPackage bp) { | ||
try { | ||
BProject project = bp.getProject(); | ||
|
||
return new JMenuItem(new OpenClassEditorAction(project.getName(), new SourceControl(project))); | ||
} catch (ProjectNotOpenException e) { | ||
return null; | ||
} | ||
} | ||
MenuItem menuItem = new MenuItem("Klasseneditor öffnen"); | ||
|
||
private static class OpenClassEditorAction extends AbstractAction { | ||
private final SourceCodeControl sourceCodeControl; | ||
private final String projectTitle; | ||
final String projectName = project.getName(); | ||
final SourceControl sourceControl = new SourceControl(project); | ||
|
||
public OpenClassEditorAction(String projectTitle, SourceCodeControl sourceCodeControl) { | ||
this.sourceCodeControl = sourceCodeControl; | ||
this.projectTitle = projectTitle; | ||
menuItem.setOnAction(event -> { | ||
new ClassEditorApplication(projectName, sourceControl).run(); | ||
}); | ||
|
||
putValue(AbstractAction.NAME, "Klasseneditor öffnen"); | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
new ClassEditorApplication(projectTitle, sourceCodeControl).run(); | ||
return menuItem; | ||
} catch (ProjectNotOpenException e) { | ||
return null; | ||
} | ||
} | ||
} |
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