Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
280cdc18
Commit
280cdc18
authored
Feb 01, 2019
by
Stefan Schuhbaeck
Browse files
add open in explorer menu item to outputfiles.
parent
ca5c2d18
Pipeline
#88068
passed with stages
in 102 minutes and 36 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereGui/resources/messages.properties
View file @
280cdc18
...
...
@@ -28,6 +28,9 @@ LoadProjectFileErrorMessage.title=Error loading project file
RenameFileErrorMessage.text
=
Could not rename the file, maybe the filename is already used.
RenameFileErrorMessage.title
=
Error
OpenInExplorerErrorMessage.text
=
Could not open output directory in explorer.
OpenInExplorerErrorMessage.title
=
Error
LoadProjectText
=
Open Project
LoadOutputText
=
Choose output...
...
...
@@ -200,6 +203,7 @@ AdjustPanel.lblStep.text=Timestep
ProjectView.mntmOutputToSceneario.text
=
Generate scenario
ProjectView.mntmRunOutput.text
=
Run offline again
ProjectView.OpenInExplorer.text
=
Open in Explorer
ProjectView.mntmCopyOutputDir.text
=
Copy output path to clipboard
SettingsDialog.chbShowPedestrianIds.text
=
Show PedestrianIds
...
...
VadereGui/resources/messages_de_DE.properties
View file @
280cdc18
...
...
@@ -169,6 +169,10 @@ listMenuRenameOutputButtonAction.title=Dateiname
renameErrorDialog.title
=
Fehler
renameErrorDialog.text
=
Der Name wird eventuell bereits verwendet.
OpenInExplorerErrorMessage.text
=
Output Ordner konnte nicht ge
\u
00F6ffnet werden.
OpenInExplorerErrorMessage.title
=
Fehler
DeleteOutputQuestionOne.text
=
Wollen Sie wirklich dieses Output-Verzeichnis l
\u
00F6schen?
DeleteOutputQuestionMultiple.text
=
Wollen Sie wirklich diese Output-Verzeichnisse l
\u
00F6schen?
DeleteOutputQuestion.title
=
Ouput l
\u
00F6schen
...
...
@@ -201,6 +205,7 @@ AdjustPanel.lblStep.text=Zeitschritt
ProjectView.mntmOutputToSceneario.text
=
Generiere Szenario
ProjectView.mntmRunOutput.text
=
Offline erneut starten
ProjectView.OpenInExplorer.text
=
In Explorer
\u
00F6ffnen
ProjectView.mntmCopyOutputDir.text
=
Kopiere Output Pfad in Zwischenablage
SettingsDialog.chbShowPedestrianIds.text
=
Fu
\u
00dfg
\u
00E4nger-Ids anzeigen
...
...
VadereGui/src/org/vadere/gui/projectview/control/ActionOpenInExplorer.java
0 → 100644
View file @
280cdc18
package
org.vadere.gui.projectview.control
;
import
org.vadere.gui.components.utils.Messages
;
import
org.vadere.gui.components.utils.SwingUtils
;
import
org.vadere.gui.projectview.model.ProjectViewModel
;
import
org.vadere.util.io.IOUtils
;
import
org.vadere.util.logging.Logger
;
import
java.awt.*
;
import
java.awt.event.ActionEvent
;
import
java.io.File
;
import
java.io.IOException
;
import
javax.swing.*
;
public
class
ActionOpenInExplorer
extends
AbstractAction
{
private
static
Logger
logger
=
Logger
.
getLogger
(
ActionRunOutput
.
class
);
private
ProjectViewModel
model
;
public
ActionOpenInExplorer
(
final
String
name
,
final
ProjectViewModel
model
)
{
super
(
name
);
this
.
model
=
model
;
}
@Override
public
void
actionPerformed
(
ActionEvent
event
)
{
try
{
ProjectViewModel
.
OutputBundle
outputBundle
=
model
.
getSelectedOutputBundle
();
File
file
=
outputBundle
.
getDirectory
();
if
(
file
.
isDirectory
()){
SwingWorker
<
Void
,
Void
>
worker
=
new
SwingWorker
<
Void
,
Void
>()
{
@Override
public
Void
doInBackground
()
throws
Exception
{
Desktop
.
getDesktop
().
open
(
file
);
return
null
;
}
};
worker
.
execute
();
}
else
{
IOUtils
.
errorBox
(
Messages
.
getString
(
"OpenInExplorerErrorMessage.text"
),
Messages
.
getString
(
"OpenInExplorerErrorMessage.title"
));
logger
.
errorf
(
"Cannot access outputBundle directory for project: %s"
,
outputBundle
.
getProject
().
getName
());
}
}
catch
(
IOException
e
)
{
logger
.
errorf
(
"Cannot get output bundle. %s"
,
e
.
getMessage
());
}
}
}
VadereGui/src/org/vadere/gui/projectview/view/ProjectView.java
View file @
280cdc18
...
...
@@ -15,6 +15,7 @@ import org.vadere.gui.projectview.control.ActionGenerateScenarioFromOutputFile;
import
org.vadere.gui.projectview.control.ActionInterruptScenarios
;
import
org.vadere.gui.projectview.control.ActionLoadProject
;
import
org.vadere.gui.projectview.control.ActionLoadRecentProject
;
import
org.vadere.gui.projectview.control.ActionOpenInExplorer
;
import
org.vadere.gui.projectview.control.ActionOutputToScenario
;
import
org.vadere.gui.projectview.control.ActionPauseScenario
;
import
org.vadere.gui.projectview.control.ActionRenameOutputFile
;
...
...
@@ -587,6 +588,8 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
new
ActionOutputToScenario
(
Messages
.
getString
(
"ProjectView.mntmOutputToSceneario.text"
),
model
)));
outputListPopupMenu
.
add
(
new
JMenuItem
(
new
ActionRunOutput
(
Messages
.
getString
(
"ProjectView.mntmRunOutput.text"
),
model
)));
outputListPopupMenu
.
add
(
new
JMenuItem
(
new
ActionOpenInExplorer
(
Messages
.
getString
(
"ProjectView.OpenInExplorer.text"
),
model
)));
JMenu
copyPath
=
new
JMenu
(
Messages
.
getString
(
"ProjectView.mntmCopyOutputDir.text"
));
outputTable
.
getSelectionModel
().
addListSelectionListener
(
new
TableSelectionListener
(
outputTable
)
{
...
...
Stefan Schuhbaeck
@stsc
mentioned in issue
#186 (closed)
·
Feb 01, 2019
mentioned in issue
#186 (closed)
mentioned in issue #186
Toggle commit list
Stefan Schuhbaeck
@stsc
mentioned in issue
#162
·
Feb 01, 2019
mentioned in issue
#162
mentioned in issue #162
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment