Methods Summary |
---|
public void | addSink(com.google.gwt.sample.kitchensink.client.Sink.SinkInfo info)
String name = info.getName();
int index = list.getWidgetCount() - 1;
MouseLink link = new MouseLink(name, index);
list.add(link);
sinks.add(info);
list.setCellVerticalAlignment(link, HorizontalPanel.ALIGN_BOTTOM);
styleSink(index, false);
|
private void | colorSink(int index, boolean on)
String color = "";
if (on) {
color = ((SinkInfo) sinks.get(index)).getColor();
}
Widget w = list.getWidget(index + 1);
DOM.setStyleAttribute(w.getElement(), "backgroundColor", color);
|
public com.google.gwt.sample.kitchensink.client.Sink.SinkInfo | find(java.lang.String sinkName)
for (int i = 0; i < sinks.size(); ++i) {
SinkInfo info = (SinkInfo) sinks.get(i);
if (info.getName().equals(sinkName)) {
return info;
}
}
return null;
|
private void | mouseOut(int index)
if (index != selectedSink) {
colorSink(index, false);
}
|
private void | mouseOver(int index)
if (index != selectedSink) {
colorSink(index, true);
}
|
public void | setSinkSelection(java.lang.String name)
if (selectedSink != -1) {
styleSink(selectedSink, false);
}
for (int i = 0; i < sinks.size(); ++i) {
SinkInfo info = (SinkInfo) sinks.get(i);
if (info.getName().equals(name)) {
selectedSink = i;
styleSink(selectedSink, true);
return;
}
}
|
private void | styleSink(int index, boolean selected)
String style = (index == 0) ? "ks-FirstSinkItem" : "ks-SinkItem";
if (selected) {
style += "-selected";
}
Widget w = list.getWidget(index + 1);
w.setStyleName(style);
colorSink(index, selected);
|