Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSSTUDIO-2072 Modified and extended functionality to paste several PV names (with an optional display name) into the Data Browser #3000

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

abrahamwolk
Copy link
Collaborator

@abrahamwolk abrahamwolk commented Apr 24, 2024

This PR implements point 3 described in the discussion #2972, i.e. 3. Modified and extended functionality to paste several PV names (with an optional display name) into the Data Browser. (The PR #2998 implements points 1 and 2 of that discussion.)

In particular, this PR adds a new context-menu item "Add PV(s) from the Clipboard" to the Data Browser that allows one to paste a collection of newline-separated PV names, optionally together with associated Display Names, into the Data Browser:
contextMenu

The collection of pasted PV names can either be added to one axis only that they share, or they can be given individual axes; the following is a screenshot of the dialog that is opened by clicking on "Add PV(s) from the Clipboard":
screenshot

EDIT (30 July 2024): The PR has now been updated to implement the proposal described in #3057 (comment).

The the original parsing mechanism (that existed before this PR) is now used when parsing PV names, with one modification only: when encountering a single quote character ', the parser will continue to the matching single quote character ', in order to allow for spaces etc in display names; this is how double quotes " and brackets () were handled already.

PV names that start and end with single quote characters are interpreted as the display name of the preceding PV name (if it exists).

…ction DroppedPVNameParser.parseDroppedPVs().
…e Messages.Name (which now has no references).
… PV" window, and rename "layout" -> "gridPane".
…me", and do not display the UI-elements for entering "Display Name.
@georgweiss
Copy link
Collaborator

General comment: this cannot be fully tested unless #2998 is merged first.

In DroppedPVNameParser, should there be another case on top of \r\n, i.e. \n, or even System.lineSeparator()?

AddPVsFromTheClipboardMenuItem has hard coded message strings.

@abrahamwolk
Copy link
Collaborator Author

In DroppedPVNameParser, should there be another case on top of \r\n, i.e. \n, or even System.lineSeparator()?

Yes, there needs to be a case for \n also. Given that Phoebus can be used on several Platforms, and that files can be exchanged between platforms, both cases need to be accounted for; it would not be sufficient to check only System.lineSeparator().

@abrahamwolk
Copy link
Collaborator Author

abrahamwolk commented May 8, 2024

After a more careful reading of the code, I think it already handles both the case \r\n and \n: if either of these characters appears, the parser stops parsing the display name.

I have now added labels for strings in AddPVsFromTheClipboardMenuItem to messages.properties.

The PR is ready for review again.

…n DroppedPVNameParser.parseDroppedPVs(). Instead, interpret names that start and end with single quotes as names for the preceding PV name.
…e. This allows for spaces and other separators inside single quotes.
…oard when pasting PVs into the Data Browser.
@abrahamwolk
Copy link
Collaborator Author

abrahamwolk commented Jul 30, 2024

The PR has now been updated to implement the proposal described in #3057 (comment).

The the original parsing mechanism (that existed before this PR) is now used when parsing PV names, with one modification only: when encountering a single quote character ', the parser will continue to the matching single quote character ', in order to allow for spaces etc in display names; this is how double quotes " and brackets () were handled already.

PV names that start and end with single quote characters are interpreted as the display name of the preceding PV name (if it exists).

@shroffk
Copy link
Member

shroffk commented Aug 29, 2024

I am adding this to the discussion topics for Sept 16th

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants