checkstyle pass
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@12 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Images.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Images.java
index e66b531..b31a813 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Images.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Images.java
@@ -79,10 +79,11 @@
}
public void onClick(Widget sender) {
- if (sender == prevButton)
+ if (sender == prevButton) {
loadImage(curImage - 1);
- else if (sender == nextButton)
+ } else if (sender == nextButton) {
loadImage(curImage + 1);
+ }
}
public void onError(Widget sender) {
@@ -96,10 +97,11 @@
}
private void loadImage(int index) {
- if (index < 0)
+ if (index < 0) {
index = sImages.length - 1;
- else if (index > sImages.length - 1)
+ } else if (index > sImages.length - 1) {
index = 0;
+ }
curImage = index;
loadingImage.setUrl("images/searching.gif");
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java
index 157ce8b..b8daab0 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/KitchenSink.java
@@ -76,10 +76,11 @@
// Show the initial screen.
String initToken = History.getToken();
- if (initToken.length() > 0)
+ if (initToken.length() > 0) {
onHistoryChanged(initToken);
- else
+ } else {
showInfo();
+ }
}
public void show(SinkInfo info, boolean affectHistory) {
@@ -87,8 +88,9 @@
// in practice, because when the history context is set, our
// onHistoryChanged() handler will attempt to show the currently-visible
// sink.
- if (info == curInfo)
+ if (info == curInfo) {
return;
+ }
curInfo = info;
// Remove the old sink from the display area.
@@ -107,9 +109,10 @@
// will ultimately result in onHistoryChanged() being called. It will call
// show() again, but nothing will happen because it will request the exact
// same sink we're already showing.
- if (affectHistory)
+ if (affectHistory) {
History.newItem(info.getName());
-
+ }
+
// Display the new sink.
sinkContainer.add(curSink, DockPanel.CENTER);
sinkContainer.setCellWidth(curSink, "100%");
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Layouts.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Layouts.java
index 3079292..c416f83 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Layouts.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Layouts.java
@@ -80,9 +80,10 @@
dock.add(scroller, DockPanel.CENTER);
FlowPanel flow = new FlowPanel();
- for (int i = 0; i < 8; ++i)
+ for (int i = 0; i < 8; ++i) {
flow.add(new CheckBox("Flow " + i));
-
+ }
+
HorizontalPanel horz = new HorizontalPanel();
horz.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
horz.add(new Button("Button"));
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Lists.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Lists.java
index 50127ff..7080ce4 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Lists.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Lists.java
@@ -53,8 +53,9 @@
list.setVisibleItemCount(10);
list.setMultipleSelect(true);
- for (int i = 0; i < sStrings.length; ++i)
+ for (int i = 0; i < sStrings.length; ++i) {
combo.addItem("List " + i);
+ }
combo.setSelectedIndex(0);
fillList(0);
@@ -76,10 +77,11 @@
}
public void onChange(Widget sender) {
- if (sender == combo)
+ if (sender == combo) {
fillList(combo.getSelectedIndex());
- else if (sender == list)
+ } else if (sender == list) {
echoSelection();
+ }
}
public void onShow() {
@@ -89,8 +91,9 @@
// Set the contents of the list box to reflect the combo selection.
list.clear();
String[] strings = sStrings[idx];
- for (int i = 0; i < strings.length; ++i)
+ for (int i = 0; i < strings.length; ++i) {
list.addItem(strings[i]);
+ }
echoSelection();
}
@@ -99,8 +102,9 @@
// Determine which items are selected, and display them.
String msg = "Selected items: ";
for (int i = 0; i < list.getItemCount(); ++i) {
- if (list.isItemSelected(i))
+ if (list.isItemSelected(i)) {
msg += list.getItemText(i) + " ";
+ }
}
echo.setText(msg);
}
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java
index b84bb1d..8fc00d3 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Popups.java
@@ -102,18 +102,19 @@
};
}
- private Button fDialogButton = new Button("Show Dialog", this);
- private Button fPopupButton = new Button("Show Popup", this);
+ private Button dialogButton = new Button("Show Dialog", this);
+ private Button popupButton = new Button("Show Popup", this);
public Popups() {
VerticalPanel panel = new VerticalPanel();
- panel.add(fPopupButton);
- panel.add(fDialogButton);
+ panel.add(popupButton);
+ panel.add(dialogButton);
ListBox list = new ListBox();
list.setVisibleItemCount(5);
- for (int i = 0; i < 10; ++i)
+ for (int i = 0; i < 10; ++i) {
list.addItem("list item " + i);
+ }
panel.add(list);
panel.setSpacing(8);
@@ -121,16 +122,16 @@
}
public void onClick(Widget sender) {
- if (sender == fPopupButton) {
+ if (sender == popupButton) {
MyPopup p = new MyPopup();
int left = sender.getAbsoluteLeft() + 10;
int top = sender.getAbsoluteTop() + 10;
p.setPopupPosition(left, top);
p.show();
- } else if (sender == fDialogButton) {
+ } else if (sender == dialogButton) {
DialogBox dlg = new MyDialog();
- int left = fDialogButton.getAbsoluteLeft() + 10;
- int top = fDialogButton.getAbsoluteTop() + 10;
+ int left = dialogButton.getAbsoluteLeft() + 10;
+ int top = dialogButton.getAbsoluteTop() + 10;
dlg.setPopupPosition(left, top);
dlg.show();
}
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Sink.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Sink.java
index 522c5ee..9f881eb 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Sink.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Sink.java
@@ -44,8 +44,9 @@
}
public final Sink getInstance() {
- if (instance != null)
+ if (instance != null) {
return instance;
+ }
return (instance = createInstance());
}
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/SinkList.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/SinkList.java
index 750ef3e..6a58a4e 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/SinkList.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/SinkList.java
@@ -49,17 +49,19 @@
public SinkInfo find(String sinkName) {
for (int i = 0; i < sinks.size(); ++i) {
SinkInfo info = (SinkInfo) sinks.get(i);
- if (info.getName().equals(sinkName))
+ if (info.getName().equals(sinkName)) {
return info;
+ }
}
return null;
}
public void setSinkSelection(String name) {
- if (selectedSink != -1)
+ if (selectedSink != -1) {
list.getWidget(selectedSink).removeStyleName("ks-SinkItem-selected");
-
+ }
+
for (int i = 0; i < sinks.size(); ++i) {
SinkInfo info = (SinkInfo) sinks.get(i);
if (info.getName().equals(name)) {
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tables.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tables.java
index e2568ea..c002e40 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tables.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tables.java
@@ -54,8 +54,9 @@
.setColSpan(1, 1, 2);
for (int i = 0; i < 10; ++i) {
- for (int j = 0; j < 5; ++j)
+ for (int j = 0; j < 5; ++j) {
inner.setText(i, j, "" + i + "," + j);
+ }
}
inner.setWidth("100%");
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tabs.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tabs.java
index 30a7c59..d7d70e6 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tabs.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Tabs.java
@@ -36,18 +36,18 @@
};
}
- private TabPanel fTabs = new TabPanel();
+ private TabPanel tabs = new TabPanel();
public Tabs() {
- fTabs.add(createImage("rembrandt/JohannesElison.jpg"), "1634");
- fTabs.add(createImage("rembrandt/SelfPortrait1640.jpg"), "1640");
- fTabs.add(createImage("rembrandt/LaMarcheNocturne.jpg"), "1642");
- fTabs.add(createImage("rembrandt/TheReturnOfTheProdigalSon.jpg"), "1662");
- fTabs.selectTab(0);
+ tabs.add(createImage("rembrandt/JohannesElison.jpg"), "1634");
+ tabs.add(createImage("rembrandt/SelfPortrait1640.jpg"), "1640");
+ tabs.add(createImage("rembrandt/LaMarcheNocturne.jpg"), "1642");
+ tabs.add(createImage("rembrandt/TheReturnOfTheProdigalSon.jpg"), "1662");
+ tabs.selectTab(0);
- fTabs.setWidth("100%");
- fTabs.setHeight("100%");
- initWidget(fTabs);
+ tabs.setWidth("100%");
+ tabs.setHeight("100%");
+ initWidget(tabs);
}
public void onShow() {
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Text.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Text.java
index 04ab83c..5e90ed5 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Text.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Text.java
@@ -47,19 +47,19 @@
};
}
- private PasswordTextBox fPasswordText = new PasswordTextBox();
- private TextArea fTextArea = new TextArea();
- private TextBox fTextBox = new TextBox();
+ private PasswordTextBox passwordText = new PasswordTextBox();
+ private TextArea textArea = new TextArea();
+ private TextBox textBox = new TextBox();
public Text() {
VerticalPanel panel = new VerticalPanel();
panel.setSpacing(8);
panel.add(new HTML("Normal text box:"));
- panel.add(createTextThing(fTextBox));
+ panel.add(createTextThing(textBox));
panel.add(new HTML("Password text box:"));
- panel.add(createTextThing(fPasswordText));
+ panel.add(createTextThing(passwordText));
panel.add(new HTML("Text area:"));
- panel.add(createTextThing(fTextArea));
+ panel.add(createTextThing(textArea));
initWidget(panel);
}
diff --git a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Trees.java b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Trees.java
index c0117d0..3e845a6 100644
--- a/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Trees.java
+++ b/samples/kitchensink/src/com/google/gwt/sample/kitchensink/client/Trees.java
@@ -93,16 +93,16 @@
};
}
- private Tree fTree = new Tree();
+ private Tree tree = new Tree();
public Trees() {
for (int i = 0; i < fProto.length; ++i) {
createItem(fProto[i]);
- fTree.addItem(fProto[i].item);
+ tree.addItem(fProto[i].item);
}
- fTree.addTreeListener(this);
- initWidget(fTree);
+ tree.addTreeListener(this);
+ initWidget(tree);
}
public void onShow() {
@@ -127,7 +127,8 @@
private void createItem(Proto proto) {
proto.item = new TreeItem(proto.text);
proto.item.setUserObject(proto);
- if (proto.children != null)
+ if (proto.children != null) {
proto.item.addItem(new PendingItem());
+ }
}
}