Skip to content

Commit

Permalink
squid:AssignmentInSubExpressionCheck Assignments should not be made f…
Browse files Browse the repository at this point in the history
…rom within sub-expressions
  • Loading branch information
zeeshanasghar committed Mar 15, 2016
1 parent 57de5ec commit eb60fbf
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class AccessDeniedView extends VerticalLayout implements View {
@PostConstruct
void init() {
setMargin(true);
addComponent(message = new Label());
message = new Label();
addComponent(message);
message.addStyleName(ValoTheme.LABEL_FAILURE);
message.setContentMode(ContentMode.HTML);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ private class ErrorView extends VerticalLayout implements View {

ErrorView() {
setMargin(true);
addComponent(message = new Label("Please click one of the buttons at the top of the screen."));
message = new Label("Please click one of the buttons at the top of the screen.");
addComponent(message);
message.addStyleName(ValoTheme.LABEL_COLORED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ void setLoggedOut(boolean loggedOut) {
private void initLayout() {
FormLayout loginForm = new FormLayout();
loginForm.setSizeUndefined();

loginForm.addComponent(userName = new TextField("Username"));
loginForm.addComponent(passwordField = new PasswordField("Password"));
loginForm.addComponent(login = new Button("Login"));
userName = new TextField("Username");
passwordField = new PasswordField("Password");
login = new Button("Login");
loginForm.addComponent(userName);
loginForm.addComponent(passwordField);
loginForm.addComponent(login);
login.addStyleName(ValoTheme.BUTTON_PRIMARY);
login.setDisableOnClick(true);
login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
Expand All @@ -88,14 +90,16 @@ public void buttonClick(Button.ClickEvent event) {

VerticalLayout loginLayout = new VerticalLayout();
loginLayout.setSizeUndefined();

loginLayout.addComponent(loginFailedLabel = new Label());

loginFailedLabel = new Label();
loginLayout.addComponent(loginFailedLabel);
loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
loginFailedLabel.setSizeUndefined();
loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
loginFailedLabel.setVisible(false);

loginLayout.addComponent(loggedOutLabel = new Label("Good bye!"));
loggedOutLabel = new Label("Good bye!");
loginLayout.addComponent(loggedOutLabel);
loginLayout.setComponentAlignment(loggedOutLabel, Alignment.BOTTOM_CENTER);
loggedOutLabel.setSizeUndefined();
loggedOutLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ protected void init(VaadinRequest request) {
FormLayout loginForm = new FormLayout();
loginForm.setSizeUndefined();

loginForm.addComponent(userName = new TextField("Username"));
loginForm.addComponent(passwordField = new PasswordField("Password"));
loginForm.addComponent(rememberMe = new CheckBox("Remember me"));
loginForm.addComponent(login = new Button("Login"));
userName = new TextField("Username");
passwordField = new PasswordField("Password");
rememberMe = new CheckBox("Remember me");
login = new Button("Login");
loginForm.addComponent(userName);
loginForm.addComponent(passwordField);
loginForm.addComponent(rememberMe);
loginForm.addComponent(login);
login.addStyleName(ValoTheme.BUTTON_PRIMARY);
login.setDisableOnClick(true);
login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class ErrorView extends VerticalLayout implements View {

public ErrorView() {
setMargin(true);
addComponent(message = new Label());
message = new Label();
addComponent(message);
message.setSizeUndefined();
message.addStyleName(ValoTheme.LABEL_FAILURE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ private class ErrorView extends VerticalLayout implements View {

ErrorView() {
setMargin(true);
addComponent(message = new Label());
message = new Label();
addComponent(message);
}

@Override
Expand Down

0 comments on commit eb60fbf

Please sign in to comment.