Skip to content

Commit

Permalink
More fixes to dialog backgrounds in GWT console
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
  • Loading branch information
Claudio Mezzasalma committed Dec 22, 2017
1 parent 54c800d commit f8b0082
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.google.gwt.resources.client.ImageResource;

public class InfoDialog extends KapuaDialog {

public enum InfoDialogType {
SUCCESS, INFO, ERROR;
SUCCESS, INFO, ERROR
}

private String headerMessage;
Expand Down Expand Up @@ -56,15 +55,15 @@ public InfoDialog(InfoDialogType infoDialogType,
this.infoMessage = infoMessage;
}

public InfoDialog(ImageResource headerIcon,
public InfoDialog(
String headerMessage,
ImageResource infoIcon,
KapuaIcon infoIcon,
String infoMessage) {
super();

this.headerMessage = headerMessage;
this.infoMessage = infoMessage;

this.infoIcon = infoIcon;
setWidth(450);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected void onRender(Element parent, int pos) {
infoPanel.setHeaderVisible(false);
infoPanel.setLayout(new TableLayout(2));
infoPanel.setStyleAttribute("background-color", "#F0F0F0");
infoPanel.setBodyStyle("background-color:transparent");
infoPanel.setBodyStyle("background-color: #F0F0F0");
add(infoPanel);

// Heading Message (if implementation needs one)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected void onRender(Element parent, int pos) {
bodyPanel.setBodyBorder(false);
bodyPanel.setHeaderVisible(false);
bodyPanel.setStyleAttribute("background-color", "#F0F0F0");
bodyPanel.setBodyStyle("background-color:transparent");
bodyPanel.setBodyStyle("background-color: #F0F0F0");

createBody();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,29 @@
package org.eclipse.kapua.app.console.module.authentication.client.tabs.credentials;

import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Element;
import org.eclipse.kapua.app.console.module.api.client.resources.icons.IconSet;
import org.eclipse.kapua.app.console.module.api.client.resources.icons.KapuaIcon;
import org.eclipse.kapua.app.console.module.api.client.ui.dialog.KapuaDialog;
import org.eclipse.kapua.app.console.module.api.client.ui.dialog.InfoDialog;
import org.eclipse.kapua.app.console.module.authentication.client.messages.ConsoleCredentialMessages;

public class ApiKeyConfirmationDialog extends KapuaDialog {
public class ApiKeyConfirmationDialog extends InfoDialog {

protected static final ConsoleCredentialMessages CRED_MSGS = GWT.create(ConsoleCredentialMessages.class);

private final String apiKey;

public ApiKeyConfirmationDialog(String apiKey) {
this.apiKey = apiKey;
super(CRED_MSGS.dialogConfirmationAPI(), new KapuaIcon(IconSet.KEY), new SafeHtmlBuilder().appendEscapedLines(CRED_MSGS.dialogAddConfirmationApiKey(apiKey)).toSafeHtml().asString());
setStyleAttribute("background-color", "#F0F0F0");
setBodyStyle("background-color: #F0F0F0");
}

@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
setButtons(Dialog.OK);
setHideOnButtonClick(true);
setSize(350, 175);
setSize(350, 200);
setScrollMode(Scroll.AUTO);
}

@Override
public String getHeaderMessage() {
return CRED_MSGS.dialogConfirmationAPI();
}

@Override
public KapuaIcon getInfoIcon() {
return new KapuaIcon(IconSet.KEY);
}

@Override
public String getInfoMessage() {
return new SafeHtmlBuilder().appendEscapedLines(CRED_MSGS.dialogAddConfirmationApiKey(apiKey)).toSafeHtml().asString();
}
}

0 comments on commit f8b0082

Please sign in to comment.