Giter VIP home page Giter VIP logo

Comments (8)

vatbub avatar vatbub commented on June 12, 2024 1

TBH it's been a while since I worked on that and I forgot what I ended up doing. I'll check tomorrow.

from controlsfx.

danielpeintner avatar danielpeintner commented on June 12, 2024

I think 2 aspects would be nice:

  • being able to copy the content even if one cannot modify it
  • still seeing visually that the content is not modifiable (as of now with the gray background, compared to white)

from controlsfx.

eugener avatar eugener commented on June 12, 2024

Sounds like a good addition!
Existing functionality should be preserved though to make sure new changes to do not break existing UIs. This can be done by putting new behavior behind the "flag" which is off by default. For example, COPY_READONLY_CONTENT. If the flag is set, we turn off field's disabled state and emulate disabled style.
Even though it is possible just to add this new functionality, I worry about existing apps as the library been out-there for almost 10 years now.
PRs are always welcome! :)

from controlsfx.

vatbub avatar vatbub commented on June 12, 2024

I tried the approach to be able to copy it without changing the visual style by creating a custom editor and have a copy-button right next to the text field and have it all wrapped in an HBox. The issue is though that AbstractPropertyEditor just disables the entire editor control (so in that case the entire HBox) and therefore also the button.

As a quick fix, I did exactly what I mentioned in the question (on my private fork of the library) and only set setEditable(false), but the entire lack of visual indication that the property is not editable is a little weird, IMO. So, at the very least, we need to emulate the disabled style.

However, I am not entirely sure if we really need a new flag if we just emulate the disabled style, but I am also not fully aware of the possible consequences of such a change given the age of the library. If we were to add a new flag, where would you suggest adding it? In the Property.Item interface?

from controlsfx.

eugener avatar eugener commented on June 12, 2024

To be honest, I'm not sure either - I just worry about the consequences to existing apps.
As for flags, I would do it as a getFlag/setFlag static methods on PropertySheet itself to simplify developer access and provide an ability to customize any part of control. Those would get and set values for specified flags into internal static map, which than can be checked by internal code to produce proper behavior. This assumes of course that we want this behavior to be uniform for all instances of the control within the application.

from controlsfx.

eugener avatar eugener commented on June 12, 2024

In theory, Node's getProperties/setProperties can be used but that only allows us to customize specific instance of the control

from controlsfx.

danielpeintner avatar danielpeintner commented on June 12, 2024

I am currently working on a fix for this issue in a fork but would like other opinions before creating a PR.

Hi @vatbub have you been able to work on it?

from controlsfx.

danielpeintner avatar danielpeintner commented on June 12, 2024

Thanks, any feedback is welcome. If there is any starting point I am interested in continuing the work.

from controlsfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.