How do I change the default row selection color? I do not see where to access this in the code snippet below:
SelectionLayer selectionLayer = glazedListsGridLayer.getBodyLayerStack()
.getSelectionLayer();
selectionLayer.setSelectionModel(new RowSelectionModel<T>(selectionLayer,
glazedListsGridLayer.getBodyDataProvider(), myRowIdAccessor));
You need to register a style for the DisplayMode.SELECT. This can be done with a custom style configuration, a theme configuration or CSS if you are in an Eclipse 4 application.
To get a basic understanding of the styling concepts have a look here: https://eclipse.org/nattable/documentation.php?page=styling
To see how the default selection style configuration is configured check the DefaultSelectionStyleConfiguration
Related
Im using codename one 3.5.8 and need to add a checkbox to a multibutton(as the example https://www.codenameone.com/javadoc/com/codename1/components/MultiButton.html) but when adding it to my code ,it seems as though it is being ignored, the checkbox is not adde to my multibutton, this behavior happens on the emulator and also on my test device(android 6.0). is there anything that needs to be apllied additional to setCheckBox(true)
img2:
img3:
In case somebody is having this same behavior, the problem is because in some themes, the checkbox images make the checkbox invisible,the solution is to delete(or replace) the checkbox related images in the constant tab(on theme editor) like explained here:
CodenameOne - change color of checkbox in theme
The MultiButton itself should become a checkbox and would be rendered based on API conventions. You might need a revalidate() if the button is already showing in the UI.
Form hi = new Form("Multibutton", BoxLayout.y());
MultiButton component = new MultiButton();
component.setTextLine1("Name");
component.setTextLine2("Numero de reservacion:");
component.setTextLine3("Fecha de reservacion:");
component.setTextLine4("Estado:");
component.setCheckBox(true);
hi.addComponent(component);
hi.show();
I used to gwt 2.5.1, java 1.6.
when used grid,
I want to centerd just grid header.
No data, Only Header.
Source
.getGrid().getColumnModel().getColumns().get(i).setAlignment(HorizontalAlignment.CENTER);
But,
Both are aligned.
So,
What Can I do?
Thank you.
Use DOM inspector and fish out the style that corresponds to your header cell.
If you named your column as "test" then the style may be named something like "x-grid3-td-test".
Add the following to your stylesheet:
.x-grid3-td-test* {
text-align: center;
}
I have seen some details from
http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/Style.Cursor.html
Did not see any example using this. I have put css class style but still cursor does not get the required cursor style.
can any one give an example please.?
This might be helpful
button.getElement().getStyle().setCursor(Cursor.POINTER);
But gwt prefer css directly
and by adding css style to the button(**preffered**)
button.addStyleName(mybuttonStyle);
.mybuttonStyle{
cursor: pointer;
}
In case this is a SmartGWT application and you want to set the cursor for a SmartGWT widget, you can use Canvas.setCursor().
IButton button = new IButton("Hover over");
button.setCursor(Cursor.CROSSHAIR);
http://forums.smartclient.com/showthread.php?p=68560
I'm developing an android application. I retrieve some data that looks like this:
My Link to Google!</font></b>
I'm applying it to a TextView like this:
myTextView.setText(Html.fromHtml(myHtmlString));
The issue I encounter here is that Html.fromHtml seems to apply a general styling
to any and all links, which is to color them blue and underline them. I'd rather not have it do this, is there any simple solution to make it not stylize links(and therefore, I assume, "font color=whatever" would apply instead)? The behavior does not change if the HTML link tag is on the inside of font/style tags.
Use android:textColorLink attribute. I'm afraid it's the only way to change link color.
If you're sure that you have only one link in the text then you can do the following:
Spanned text = Html.fromHtml(myHtmlString);
ForegroundColorSpan spans[] = text.getSpans(0, text.length(),
ForegroundColorSpan.class);
if (spans.length > 0) {
myTextView.setLinkTextColor(spans[0].getForegroundColor());
}
myTextView.setText(text);
How to change single element of the widget style in GWT. I would like to create new version of TextBox style, so that only the border color changed to red, for example.How to get to the style responsible for the TextBox?
I tried to create new style
.gwt-TextBox.invalid {
border-color: red;
}
but it does not work.
Make sure you add class invalid to your TextBox:
textBox.addStyleName("invalid");
Use CssResource to associate your CSS file with GWT: http://code.google.com/webtoolkit/doc/latest/DevGuideUiCss.html#cssfiles