CSS changes in oXygen eclipse 16.1!!

Post here questions and problems related to editing and publishing DITA content.
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi team,

We would like to work on some customization to the oXygen 16.1 eclipse plugin in the editor view like providing some tooltips to the users while clicking on or moving cursor to a particular element.

Eg :- If user's cursor position is in <booknumber>, there a popup should come with a tooltip text indicating that the particular element is used for providing document number, something like that. From our understanding, it is possible by adding some CSS code to "topic.css" file. In oXygen help documents, it is mentioned that oxy_editor can be used for many css changes.

Could you please let us know whether we can use the same for Tooltip text also in oXygen 16.1 eclipse. Please help in the same!

Thanks in advance!

Regards,
Shabeer
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: CSS changes in oXygen eclipse 16.1!!

Post by alex_jitianu »

Hi Shabeer,

The *oxy_editor* CSS function binds a form control in the document. There isn't a built-in form control for displaying documentation (there will be one in version 17.0) so if you want to go on that path you will have to implement a custom form control. Another aspect to consider is that the form control will appear in the layout of the document when hovering which might be a little intrusive (in version 17.0 there will be support for absolute positioning - blocks that do not take part in the layout).

I believe that a better approach would be to use the StyleGuide integration available in Oxygen. A style guide is just about telling the users what they should do in a given context. A styleGuide contribute with hints or links on the tooltip presented for an element. For DITA we have such a default integration. If you hover over a shortdesc element and press F2 you will see a link named DITA Style Guide. For this particular element we've chosen not to present the hints directly in the tooltip but to offer a link instead.

Take a look inside frameworks/dita/styleguide folder especially at contentCompletionElementsMap.xml. Each mapping element has a type attribute. If you set it to content, the documentation text will be presented right inside the tooltip window. The only "drawback" would be that the user has to press "F2" to see the documentation.

Best regards,
Alex
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi,

i want to do some modification in the existing function. can you share me about the implemention file for all the function so that i can modify according to my requirement.

thanks,
Shabeer
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: CSS changes in oXygen eclipse 16.1!!

Post by alex_jitianu »

Hello Shabeer,

I'm not sure about do you mean by "the existing function". Can you give me more details?

Best regards,
Alex
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi Alex,

Actually i want to modify the implementation of oxy_name() and oxy_editor() function. could you please share me the details of the file so that i can iplement hovering in this function.

Thanks,
Shabeer
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: CSS changes in oXygen eclipse 16.1!!

Post by alex_jitianu »

Hello Shabeer,

oxy_name is not extensible. What exactly do you want to change to it? Maybe you can use oxy_xpath() instead.

oxy_editor is a shorthand for a number of form controls (text field, combo box). Which one would you need as a starting point and what would you like to change to it? (they have different implementations)

Best regards,
Alex
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi Alex,

Thank you for the response!

We would like to implement tool tip for some elements in oxygen in author mode (oXygen Author 16.1 eclipse plugin).

As you have mentioned in the previous mails, we understand that there is no built-in function for the same. So we would like to create a new function or extend any of the existing oXygen CSS function for the same. But we do not know how we can proceed with this.

We have checked the possibility of using style guide. But as it has a draw back that user needs to press F2 button to get the same, we cannot proceed with that.

Could you please let us know a way forward so that the Tool tip can be implemented.

Thanks in advance!

Regards,
Shabeer
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: CSS changes in oXygen eclipse 16.1!!

Post by alex_jitianu »

Hello Shabeer,

We've release a beta build for version 17.0. In the version 17.0 we added a form control that can render HTML and you can use it to present hints next to an element. We've used it for the DITA framework. For DITA you can now activate a "Hints" layer that will contribute with hints to some elements. I will send you an email with the download link so you can give it a try. If you like the way it looks I can give you some advices and code snapshots on how you can create something similar.

Best regards,
Alex
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi Alex,

Thanks a lot for helping us!

We liked the way the new form control appears in 17.0 and would like to get something similar for our tool tip also.

For our requirement, what exactly we need is, once user clicks/hover over some particular element user should get the similar form control as a tool tip and once user click outside of the tooltip, it should disappear also.

We do not know whether it is possible to implement in the author 16.1 eclipse version.

But if it is possible, please help us in doing the same!

Regards,
Shabeer
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: CSS changes in oXygen eclipse 16.1!!

Post by alex_jitianu »

Hello Shabeer,

I've sent you some code and advices on your email address.

According to your requirements, an alternative solution would be to listen for mouse or caret events and present the tooltip in a Shell as per the code below:
final WSEditor ed = (WSEditor) activePart;
final WSAuthorEditorPage currentPage = (WSAuthorEditorPage) ed.getCurrentPage();
currentPage.addAuthorMouseListener(new AuthorMouseAdapter() {
@Override
public void mouseMoved(AuthorMouseEvent e) {
AuthorViewToModelInfo viewToModel = currentPage.viewToModel(e.X, e.Y);
AuthorNode authorNode = viewToModel.getAuthorNode();
// TODO Compute the tooltip.
// TODO use a Shell to present it. You can use
// org.eclipse.swt.browser.Browser to render HTML.
}
});
Some aspects to consider with the Shell approach:
- instead of a mouse listener you could use a caret listener
- it is recommended to use coalescing when presenting the tooltip. On the event, reset a timer. When this timer executes it will present the tooltip. This way the tooltip is presented once and only after the user lingers over an element.

Best regards,
Alex
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi Team,

I need to disable all the element tags of the prolog section in the author view when ‘full tags’ mode is on.
Could you please let me know what should I do, So that I can resolve this problem.

Thanks,
Shabeer
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by Radu »

Hi Shabeer,

You coudl customize the CSS used for rendering the content in the Author editing mode:

Code: Select all

http://www.oxygenxml.com/doc/ug-oxygen/#topics/dg-display-tags.html
with something like:

Code: Select all


prolog, prolog *{
-oxy-display-tags: none;
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: CSS changes in oXygen eclipse 16.1!!

Post by mu258770 »

Hi Radu,

Thank you so much.. its working fine :) .

Thanks,
Shabeer
Post Reply