How do I get a multi line in GXT ToolTipConfig? - gxt

How do I get a multi line in GXT ToolTipConfig?
I have a long Text in the ToolTipConfig's title. How can I break it to multi line?

Try setting up this wordwrap css property attribute to the ToolTip titles html tag.
div.test {word-wrap:break-word;}
http://www.w3schools.com/cssref/css3_pr_word-wrap.asp

I think, this is what you need:
ToolTipConfig config = new ToolTipConfig();
config.setMaxWidth(300);
So, the tooltip will move the lines for you.

Related

How to wrap af:inputFile text name?

I am using JDeveloper 11.1.2.3.0,
I have an inputFile component in my page that takes its text value from the name of some components. The problem is that that when the text is long it gets displayed all there and may even occupy the whole window. Is there any possibility to wrap this text value in this case?
I don't think <af:inputFile> has a labelStyle attribute:
You can try adding the CSS in the component's inlineStyle or contentStyle
<af:inputFile inlineStyle="word-wrap:break-word;" />
It depends if the very long text is in the content or the label of the field.
If this doesn't do the trick, you can try creating a custom skin and customizing the label or content style via the adf style selectors: af|inputFile::content , af|inputFile::label.
Btw, you need to check if word-wrap works on all browsers you're targeting.
You can try setting the labelStyle attribute of the <af:inputFile> component to wrap the contents of the label. I am not sure of the CSS style attribtue information for it, but searching on the net I found word-wrap:break-word;.
I too had this problem with af:inputFile.
Just give contentStyle="width:200px" it will solve the issue.
we can adjust the width accordingly.

JavaFX HTML styling (or equivalent) labels

In Swing, it was trivially easy to style a JLabel using HTML - you simply used the HTML you wanted as the text for the label, and it was rendered appropriately.
In JavaFX this isn't available, but we can set the style of a particular label (or node in general) using the setStyle() method.
However, using this approach it's not obvious how to set part of a label to be a certain style, for instance the equivalent of:
JLabel label = new JLabel("<html>Part of this <b>text is b</b>old and part isn't.</html>");
What would be the easiest way to achieve something like the above?
You can try using TextFlow to combine different styled text nodes like
TextFlow textFlow = new TextFlow();
Text first=new Text("Part of this ");
first.setStyle("-fx-font-weight: regular");
Text second=new Text("text is b");
second.setStyle("-fx-font-weight: bold");
Text third=new Text("old and part isn't.");
third.setStyle("-fx-font-weight: regular");
textFlow.getChildren().addAll(first, second, third);
Pseudo-selectors could have been a work-around but unfortunately most of them are not supported yet - http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#introlimitations. As for Rich Text Support in controls, they will be provided by JavaFX8 - https://bugs.openjdk.java.net/browse/JDK-8091709.

How do I get tag info from text?

I have written an application using Python 2.7 and Tkinter that edits *.docx files. In the Text control where the user is able to write text, I can change the font family and fontsize with tag_add and tag_config. Now I need to write this to new *.docx file. How can I retrieve fontfamily and fontsize that were set in several of the text ranges?
My best guess is to get tag from range and later try to get font from this, but I'm not sure.
I have just solved my problem myself :)
Maybe anyone will need it somewhen. You can read any applied attribute from a tag. To do this, you have to use tag_cget method:
selectedFont = textBox.tag_cget("tagName", 'font')
Now, when we got the font from specially tag, we can get from it other attributes by the same way:
fontFamily = selectedFont.cget('family')
It works! ;)

LWUIT display bold text + normal text

I need to display some Rich-Text in LWUIT.
I was thinking of HTML Component, but I can't get linewrapping there - probably an error on my side.
Another idea would be to use TextAreas or Labels and do it manually.
I'd need the possibility to have bold words in a non bold sentence.
Hello, this is a bold. <- This dot shouldn't be bold.
Is there a way I can achieve that? I think I only can use one Font per Component...
Use a Container with flow layout and just place labels into it. This is what the HTML Component does internally.
Try com.sun.lwuit.html.HTMLComponent class. Use it like,
HTMLComponent htmlComp = new HTMLComponent(null);
htmlComp.setBodyText("<b>Hello</b>, this is a <b>bold</b>. <- This dot shouldn't be <b>bold</b>.");
form.addComponent(htmlComp);
This component will allow you to use html tags inside text. For more information, refer this link: HTMLComponent

how to i add views to linear layout in upward direction?

I am using Linear Layout to display image view and text view.
I am getting the response from server by using XML parsing.
When i am getting the new response from server the second image view and related text will be displayed in the bottom of the new Layout and so on.
but i want to display the image with related text in the above of the previous Layout.
if any one see this question, please help me.
Thanks in advance.
You can add it programmatically with:
LinearLayout layout = findViewById(R.id.layout);
layout .addView(newView, index);
You just have to add always with index = 0

Resources