Bug 4147: javadoc + cleanup

This commit is contained in:
Steffen Jacobs
2018-10-31 14:50:11 +01:00
parent 29cf649eb7
commit e32717dec7
5 changed files with 35 additions and 58 deletions
@@ -20,63 +20,23 @@
min-width: 11em;
}
@media ( max-width: 400px) {
.dialog {
width: 90%;
}
}
@media ( min-width: 400px) {
.dialog {
width: 50%;
}
}
@media ( min-width: 600px) {
.dialog {
width: 40%;
}
}
.message {
margin-bottom: .5em;
text-align: center;
}
.yesButton {
.destructiveButton {
background-color: #e94a1b;
}
.yesButton:hover {
.destructiveButton:hover {
background-color: #cd3e14;
}
.yesButton:active {
.destructiveButton:active {
background-color: #a73210;
}
.noButton {
background-color: #008fcc;
}
.noButton:hover {
background-color: #00b3ff;
}
.noButton:active {
background-color: #0074a6;
}
.button {
display: inline;
width: 4em;
height: 2.5em;
border-radius: .25em;
border: none;
font-weight: 700;
color: #fff;
}
.buttonPanel {
text-align: center;
}
@@ -95,4 +55,22 @@
color: #555;
font-weight: 600;
margin-bottom: .75em;
}
@media ( max-width: 400px) {
.dialog {
width: 90%;
}
}
@media ( min-width: 400px) {
.dialog {
width: 50%;
}
}
@media ( min-width: 600px) {
.dialog {
width: 40%;
}
}
@@ -17,11 +17,7 @@ public interface DialogResources extends ClientBundle {
String message();
String yesButton();
String noButton();
String button();
String destructiveButton();
String buttonPanel();
@@ -13,7 +13,7 @@ import com.google.gwt.user.client.ui.Widget;
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
/**
* dialog panel for yes/no confirm dialog which contains a yes button, a no button and a message field with the message
* Dialog panel for yes/no confirm dialog which contains a yes button, a no button and a message field with the message
* in it.
*/
public class TwoOptionsDialogPanel extends Composite {
@@ -51,13 +51,15 @@ public class TwoOptionsDialogPanel extends Composite {
titleField.setInnerText(title);
}
/** Sets the labels of the {@link #firstButton} and {@link #secondButton}. */
public void setButtonLabels(String firstButtonText, String secondButtonText) {
firstButton.setText(firstButtonText);
secondButton.setText(secondButtonText);
}
/** Changes the color of the {@link #firstButton} to red. */
public void setFirstButtonDestructive() {
firstButton.addStyleName(DialogResources.INSTANCE.css().yesButton());
firstButton.addStyleName(DialogResources.INSTANCE.css().destructiveButton());
}
@UiHandler("firstButton")
@@ -12,8 +12,8 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
public final class ConfirmDialogFactory {
/**
* creates a yes/no {@link TwoOptionsDialogPanel} with {@link #message}, which calls
* {@link DialogCallback#ok(Object)} or {@link DialogCallback#cancel()}
* Creates a yes/no {@link TwoOptionsDialogPanel} with {@link #message}, which calls
* {@link DialogCallback#ok(Object)} or {@link DialogCallback#cancel()}.
*/
public static void showConfirmDialog(final String message, final String title,
final DialogCallback<Void> callback) {
@@ -30,7 +30,7 @@ public final class WhatsNewDialogFactory {
private WhatsNewDialogFactory() {
}
/** automatically shows the whats-new dialog after login, if necessary */
/** Automatically shows the whats-new dialog after login, if necessary. */
public static void registerWithUserService(UserService userService, PlaceController placeController) {
userService.addUserStatusEventHandler((userDTO, b) -> {
if (userDTO != null) {
@@ -95,6 +95,12 @@ public final class WhatsNewDialogFactory {
}
}
@Override
public void onFailure(Throwable caught) {
LOG.log(Level.SEVERE, caught.getMessage(), caught);
}
/** Updates or creates a {@link WhatsNewSettings} object. */
private void updateOrCreatePreference(long linesInWhatsChangedDocument,
SettingsToJsonSerializerGWT settingsToJsonSerializerGWT) {
String serializedSetting = settingsToJsonSerializerGWT
@@ -111,11 +117,6 @@ public final class WhatsNewDialogFactory {
}
});
}
@Override
public void onFailure(Throwable caught) {
LOG.log(Level.SEVERE, caught.getMessage(), caught);
}
});
}