Omit Dialog, which appears when CSS file changes

<oXygen/> general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Omit Dialog, which appears when CSS file changes

Post by SSC » Fri Nov 23, 2012 12:16 am

Hello,

we are using the Eclipse version of oXygen 14.1.

Is it somehow possible to omit the dialog, which is asking to fresh the editor, when the CSS file, which is currently used, is changed at runtime?
Under certain circumstances we change the CSS during runtime and it is annoying, if you´re always asked, if you want to reload the editor with the new CSS file.

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6185
Joined: Fri Jul 09, 2004 5:18 pm

Re: Omit Dialog, which appears when CSS file changes

Post by Radu » Fri Nov 23, 2012 11:18 am

Hi Simon,

Right now it's not possible to avoid showing this dialog when the directly associated CSS changes externally.

We'll discuss not showing the dialog at all if the CSSs change externally, probably it's not very helpful for the user to see it.

I'm also considering adding some API which would allow developers to do something like:
setAdditionalStyles(String cssSystemID, Reader cssContents)
Basically the CSS referenced from the XML would still be used but you could set via the API an additional CSS (or CSS content) which would be combined with the base CSS (overwriting selectors where appropriate). Would you consider such an API useful for your integration? What is your usecase for changing the CSS externally?

For now maybe one workaround for you would be this one:

Oxygen only checks if the directly associated CSS file changes on disk (if it has a different timestamp).
So you could have a directly associated CSS which does not change externally which imports a module CSS in which you make changes. Oxygen would not detect changes in the module CSS so after you chnage the CSS externally you would have to call this API method:

Code: Select all

ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.refresh()
Or you could change the directly associated CSS on disk but restore its timestamp to the original one, in this way Oxygen would not know that a change occured.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: Omit Dialog, which appears when CSS file changes

Post by SSC » Fri Nov 23, 2012 12:30 pm

Hello Radu,
Basically the CSS referenced from the XML would still be used but you could set via the API an additional CSS (or CSS content) which would be combined with the base CSS (overwriting selectors where appropriate). Would you consider such an API useful for your integration?
Currently we do not have a usecase for such an API enhancement, but I would say it is a good idea to offer such an API. It is quite useful am I am pretty sure that we will use it some day.
What is your usecase for changing the CSS externally?
The usecase is the circumstance that some user groups in our CMS are allowed to modify the CSS for certain document types. Therefore the CSS is delivered from the server each time a user opens a document, which in some cases override the CSS, which is actually used by a document, which is already opened.

1. User A opens XML document A
-> Document A, schema and CSS files are download from the server.
2. User A also opens XML document B, which is the same type as document A
-> Document B is downloaded and schema and CSS files of Document A are overriden.
3. Dialog, which asks for refresh occurs.
We'll discuss not showing the dialog at all if the CSSs change externally, probably it's not very helpful for the user to see it.
Often such kinds of dialogs contain a Checkbox with a text like "Remember my decision".
An the decision would then be a property in the preference, which can be changed by the user later on, if the users want´s to change the decision.
So we could put the property to "reload CSS on CSS file change" to true beforehand.

How do you consider this suggestion?

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6185
Joined: Fri Jul 09, 2004 5:18 pm

Re: Omit Dialog, which appears when CSS file changes

Post by Radu » Fri Nov 23, 2012 1:13 pm

Hi Simon,

Thanks for the comments.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply