Skip to content

Commit

Permalink
edit log entry context menu action ( first pass )
Browse files Browse the repository at this point in the history
  • Loading branch information
shroffk committed Jul 3, 2023
1 parent fa0f3d9 commit bcd4dd0
Show file tree
Hide file tree
Showing 6 changed files with 1,060 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.phoebus.logbook.olog.ui.query.OlogQuery;
import org.phoebus.logbook.olog.ui.query.OlogQueryManager;
import org.phoebus.logbook.olog.ui.write.LogEntryEditorStage;
import org.phoebus.logbook.olog.ui.write.LogEntryUpdateStage;
import org.phoebus.olog.es.api.model.LogGroupProperty;
import org.phoebus.olog.es.api.model.OlogLog;
import org.phoebus.security.store.SecureStore;
Expand Down Expand Up @@ -168,7 +169,12 @@ public void initialize() {
menuItemNewLogEntry.acceleratorProperty().setValue(new KeyCodeCombination(KeyCode.N, KeyCombination.CONTROL_DOWN));
menuItemNewLogEntry.setOnAction(ae -> new LogEntryEditorStage(new OlogLog(), null, null).show());

contextMenu.getItems().addAll(groupSelectedEntries, menuItemShowHideAll, menuItemNewLogEntry);
MenuItem menuItemUpdateLogEntry = new MenuItem(Messages.UpdateLogEntry);
menuItemUpdateLogEntry.visibleProperty().bind(Bindings.createBooleanBinding(()-> selectedLogEntries.size() == 1, selectedLogEntries));
menuItemUpdateLogEntry.acceleratorProperty().setValue(new KeyCodeCombination(KeyCode.U, KeyCombination.CONTROL_DOWN));
menuItemUpdateLogEntry.setOnAction(ae -> new LogEntryUpdateStage(selectedLogEntries.get(0), null).show());

contextMenu.getItems().addAll(groupSelectedEntries, menuItemShowHideAll, menuItemNewLogEntry, menuItemUpdateLogEntry);
contextMenu.setOnShowing(e -> {
try {
SecureStore store = new SecureStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public class Messages
PreviewOpenErrorTitle,
SelectFile,
SelectFolder,
ShowHideDetails;
ShowHideDetails,
UpdateLogEntry;

static
{
// initialize resource bundle
Expand Down
Loading

0 comments on commit bcd4dd0

Please sign in to comment.