mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 14:57:12 +00:00
introduced more settings types; introduced AbstractSettings
This commit is contained in:
1 parent
8b6f05cfb3
commit
3be144894c
50 files changed
+152
-97
No files matched your search
+2
-2
@@ -2,9 +2,9 @@ package com.sap.sse.gwt.client.shared.components;
|
||||
|
||||
import com.google.gwt.user.client.ui.LazyPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
|
||||
public abstract class AbstractLazyComponent<SettingsType extends Settings> extends LazyPanel implements LazyComponent<SettingsType> {
|
||||
public abstract class AbstractLazyComponent<SettingsType extends AbstractSettings> extends LazyPanel implements LazyComponent<SettingsType> {
|
||||
|
||||
@Override
|
||||
public Widget getEntryWidget() {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package com.sap.sse.gwt.client.shared.components;
|
||||
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
|
||||
public interface ComponentGroup<SettingsType extends Settings> extends Component<SettingsType> {
|
||||
public interface ComponentGroup<SettingsType extends AbstractSettings> extends Component<SettingsType> {
|
||||
|
||||
boolean addComponent(Component<?> component);
|
||||
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
import com.sap.sse.gwt.client.StringMessages;
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ import com.sap.sse.gwt.client.StringMessages;
|
||||
*
|
||||
* @param <SettingsType>
|
||||
*/
|
||||
public class ComponentToolbarEntry<SettingsType extends Settings> extends HorizontalPanel {
|
||||
public class ComponentToolbarEntry<SettingsType extends AbstractSettings> extends HorizontalPanel {
|
||||
private static ComponentResources resources = GWT.create(ComponentResources.class);
|
||||
|
||||
private final Component<SettingsType> component;
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package com.sap.sse.gwt.client.shared.components;
|
||||
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
|
||||
public class CompositeSettings implements Settings {
|
||||
public static class ComponentAndSettingsPair<SettingsType extends Settings> extends Util.Pair<Component<SettingsType>, SettingsType> {
|
||||
public class CompositeSettings extends AbstractSettings {
|
||||
public static class ComponentAndSettingsPair<SettingsType extends AbstractSettings> extends Util.Pair<Component<SettingsType>, SettingsType> {
|
||||
private static final long serialVersionUID = -569811233041583043L;
|
||||
|
||||
public ComponentAndSettingsPair(Component<SettingsType> a, SettingsType b) {
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
import com.sap.sse.gwt.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.shared.components.CompositeSettings.ComponentAndSettingsPair;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CompositeTabbedSettingsDialog extends SettingsDialog<CompositeSetti
|
||||
}
|
||||
}
|
||||
|
||||
private <SettingsType extends Settings> void updateSettings(ComponentAndSettingsPair<SettingsType> componentAndSettings) {
|
||||
private <SettingsType extends AbstractSettings> void updateSettings(ComponentAndSettingsPair<SettingsType> componentAndSettings) {
|
||||
componentAndSettings.getA().updateSettings(componentAndSettings.getB());
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package com.sap.sse.gwt.client.shared.components;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.Validator;
|
||||
import com.sap.sse.gwt.client.shared.components.CompositeSettings.ComponentAndSettingsPair;
|
||||
@@ -43,7 +44,7 @@ public class CompositeValidator implements Validator<CompositeSettings> {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private <SettingsType extends Settings> String getErrorMessage(ComponentAndSettingsPair<SettingsType> componentAndSettings) {
|
||||
private <SettingsType extends AbstractSettings> String getErrorMessage(ComponentAndSettingsPair<SettingsType> componentAndSettings) {
|
||||
for (ComponentAndValidator<?> componentAndValidator : validators) {
|
||||
if (componentAndValidator.getA() == componentAndSettings.getA()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package com.sap.sse.gwt.client.shared.components;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
|
||||
public interface LazyComponent<SettingsType extends Settings> extends Component<SettingsType> {
|
||||
public interface LazyComponent<SettingsType extends AbstractSettings> extends Component<SettingsType> {
|
||||
Widget createWidget();
|
||||
}
|
||||
+2
-1
@@ -5,6 +5,7 @@ import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.FocusWidget;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.gwt.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
@@ -21,7 +22,7 @@ public class SettingsDialog<SettingsType extends Settings> extends DataEntryDial
|
||||
* component and when confirmed, updates that component's settings. The button has no CSS style attached to
|
||||
* give callers full flexibility as to how to style the button.
|
||||
*/
|
||||
public static <T extends Settings> Button createSettingsButton(final Component<T> component, final StringMessages stringMessages) {
|
||||
public static <T extends AbstractSettings> Button createSettingsButton(final Component<T> component, final StringMessages stringMessages) {
|
||||
Button settingsButton = new Button();
|
||||
settingsButton.setTitle(stringMessages.settings());
|
||||
settingsButton.addClickHandler(new ClickHandler() {
|
||||
|
||||
+2
-1
@@ -2,10 +2,11 @@ package com.sap.sse.gwt.client.shared.components;
|
||||
|
||||
import com.google.gwt.user.client.ui.FocusWidget;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.Validator;
|
||||
|
||||
public interface SettingsDialogComponent<SettingsType> {
|
||||
public interface SettingsDialogComponent<SettingsType extends Settings> {
|
||||
/**
|
||||
* Called by the framework to obtain the widget to show in the settings dialog. Called each time before the
|
||||
* settings dialog is shown, therefore also before {@link #getResult()} is called and before any method on
|
||||
|
||||
Reference in new issue
Block a user