I am using tool tip in wicket.It shows by delay and I couldn't speed it up.I want to make some css attributes for it . How can I do?
inputTextField.add(AttributeModifier.append("title", "I am a tool tip in wicket"))
The style-attribute can be added the same way you used the AttributeModifier for the title-attribute.
inputTextField.add(new AttributeAppender("style", Model.of("border: 1px solid red;")));
But I think this will not solve your "delay problem" (it is not Wicket related). You could pick a decent JavaScript library that draws you tooltip boxes on mouse over.
There are also pure CSS tooltip libraries, for example: hint.css
Related
I'm using ScalaFX, which is currently proving itself to be thoroughly useless and bugging out anytime I try to use css. Is there any way to change the fill color of a Slider without using css, or at least without separate css files?
I've managed to change the track color with slider.setStyle("-fx-control-inner-background: #f08080;"), but can't get the thumb working.
You could use the -fx-base property, which sets the component colors palette according to the value you specify.
Example:
slider.setStyle("-fx-base: #f08080;");
Result:
However why don't you consider using a CSS file? It simplifies everything and allows you to make a lot more customizations. Take a look at the Slider JavaFX CSS reference, I think you will find what you're looking for.
I've been bashing my brain against this one for a few days but I can't find a straight forward answer to the question on google. There's plenty of CSS stuff but I don't really know what crosses over from general CSS domain into JavaFX CSS domain (if any of it does, and really I'm nto sure that anything does).
I have a label that is functionally a button. It has 3 states reflected by CSS:
1: Idle, nothing special.
2: Hovered This is where I want the text to appear "raised"
3: Pressed: I was able to figure this out.
For hovered I have the following CSS:
.label:hovered{
//What goes in here to make the text appear embossed (raised) when the cursor
//is hovering over it?
}
I've tried the -fx-effect : innershadow(...) but it isn't really providing the ideal desired effect.
EDIT:: For a bit of clarity this is for what I am going (See #3). I tried the CSS but it did not work.
The appearance of the control is thus right now:
You can use a Lighting effect, here is a link to the Oracle tutorial on lighting.
The effect cannot be applied via CSS in Java 8. You could apply it in code or via xml.
You can add a listener on the hover property of a node to switch lighting off by setting the node effect to null and to switch it on by setting the node effect to you lighting.
There is example code in the JavaFX javadoc on Lighting, which I've just reproduced here:
Light.Distant light = new Light.Distant();
light.setAzimuth(-135.0);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("JavaFX!");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 60));
text.setX(10.0);
text.setY(10.0);
text.setTextOrigin(VPos.TOP);
text.setEffect(lighting);
A drop shadow would also work and there are likely other ways to achieve what you want, all with slightly varying results.
I have a simple question, I am trying to build something similar to whats in this URL
Visit: http://demo.vaadin.com/sampler-for-vaadin6
Specifically, I want to know how to create those boxes , which can be clicked on ? I am not sure what these are? whether they are links or images or buttons?
I also what the box around it when a mouse is moved over these boxes. Any sample code is highly appreciated.
The sampler page is created with Vaadin. According to FireBug it's made with a CSSLayout and those boxes are made with links. The hover effect is made with the following css attribute:
.v-csslayout-grid .screenshot a:hover span {
background: url("screenshot-frame-hover.png") no-repeat scroll 1px 0px transparent;
}
You can find the code for a "relatively" recent version of the Vaadin 6 Sampler here.
At least this version (which I believe to be 6.7.4) should give you some examples of what you're looking for.
I know this question has been asked before on S.O. and other websites but I haven't found a definite answer -- most of them say its not easily done but I wanted to make sure that was the final verdict.
Here's my situation:
I'm testing a website that is using Highcharts (http://www.highcharts.com) using Selenium WebDriver (Java).
I basically want to grab the information that is displayed in a small tooltip pop-up that appears when you hover your mouse over each datapoint on the Highchart's line graph.
Looking at the web page's HTML code, I noticed there is <g class="highcharts-tooltip".... I also noticed that, as you move your mouse, the (X,Y) values in ...transform="translate(X,Y)"> change, which then changes the information displayed in the tool tip.
Knowing this, my approach would be to somehow grab all the (X,Y) values and plug them into the transform fields and grab the tooltip data. But I don't know how to programmatically grab all the (X,Y) values through Selenium.
Has anyone tackles this issue in the past or has a better way to grab the necessary information?
I started creating a library to work with HighCharts, what I currently have is available here:
https://github.com/Ardesco/Powder-Monkey/tree/master/src/main/java/com/lazerycode/selenium/graphs
It's quite hard to provide a generic library that deals with HighCharts as the customisation options on the individual charts can modify the SVG markup quite a bit. Hopefully the above will help to a degree.
As I do more it will be updated.
The Line Charts have to have a background to work. If the chart is created with .setBackgroundColour(null), then the "rect" is not added to the html.
I was able to to add the background colour back in set to the body background colour. However I'll try and figure out a way of doing it without the "rect".
In Windows 7 if we set the content of a Folder in Details view, then it turns into a table like structure, in which if we hover a row it renders a rectangular shape with light blue color and slightly curvy corner on that row and if we select a row a similar shape with blue color set on that row. This similar effect is shown by Vuze's table.
Is there any way to achieve this table rendering for JTable? If so what is the way to get it?
Any information will be helpful to me.
Thanks in advance.
The highlighted portions in the following image shows what I intended to achieve. The first highlight is the selected row and the second one is hovered.
you can do that by implement Substance Custom Look and Feel for JTreeTable,
plugin for SwingX
TreeTable by aepryh (best and open code for TreeTable)
notice you have to change XxxRenderer to SubstanceXxxRenderer (works on Xp / Win7 / 2008R2)
There's nothing built-in to achieve this. You can achieve the hover effect by using custom cell renderers and mouseover listeners. This answer gives you an overall picture of what to do.
As for the rectangular effect, again - custom cell renderers only, with either images, or drawRoundRect
I just noticed this post. JIDE has a component that does what you need. It is in paid JIDE Grids product. You can find a screenshot at http://www.jidesoft.com/images/navigation-components.png. Of course you can do this by yourself by overriding the paintComponent of a regular JTable. Using cell renderer approach won't work as the rollover effect needs to span the whole row.