mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 20:03:52 +00:00
added a bit of logic for a component "forest" (multi-rooted tree)
This commit is contained in:
1 parent
37b33bea6e
commit
af0c6002aa
6 files changed
+39
-11
No files matched your search
+1
-6
@@ -9,12 +9,7 @@ package com.sap.sailing.gwt.ui.shared.components;
|
|||||||
* the type that describes this component's settings (if any). Use {@link Object} in case your components
|
* the type that describes this component's settings (if any). Use {@link Object} in case your components
|
||||||
* doesn't support any settings.
|
* doesn't support any settings.
|
||||||
*/
|
*/
|
||||||
public interface Component<SettingsType> {
|
public interface Component<SettingsType> extends ComponentForestEntry {
|
||||||
/**
|
|
||||||
* @return the name to display to a user for quick navigation to this component
|
|
||||||
*/
|
|
||||||
String getLocalizedShortName();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return whether this component has settings that a user may change; if so,
|
* @return whether this component has settings that a user may change; if so,
|
||||||
*/
|
*/
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.sap.sailing.gwt.ui.shared.components;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link Component}s are arranged in an "ordered forest" structure (multi-rooted tree with the roots ordered in a sequence).
|
||||||
|
* Each hierarchy level can optionally provide a localized name. Each hierarchy level consists of one or more
|
||||||
|
*
|
||||||
|
* @author Axel Uhl (d043530)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface ComponentForest extends ComponentForestEntry {
|
||||||
|
Iterable<ComponentForest> getEntries();
|
||||||
|
}
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package com.sap.sailing.gwt.ui.shared.components;
|
||||||
|
|
||||||
|
public interface ComponentForestEntry {
|
||||||
|
/**
|
||||||
|
* @return the name to display to a user for quick navigation to this component
|
||||||
|
*/
|
||||||
|
String getLocalizedShortName();
|
||||||
|
}
|
||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
package com.sap.sailing.gwt.ui.shared.components;
|
|
||||||
|
|
||||||
public interface ComponentHierarchy {
|
|
||||||
|
|
||||||
}
|
|
||||||
+10
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.shared.components;
|
|||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.FocusWidget;
|
||||||
import com.sap.sailing.gwt.ui.client.DataEntryDialog;
|
import com.sap.sailing.gwt.ui.client.DataEntryDialog;
|
||||||
import com.sap.sailing.gwt.ui.client.StringConstants;
|
import com.sap.sailing.gwt.ui.client.StringConstants;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
@@ -30,4 +31,13 @@ public class SettingsDialog<SettingsType> extends DataEntryDialog<SettingsType>
|
|||||||
return settingsDialogComponent.getResult();
|
return settingsDialogComponent.getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
super.show();
|
||||||
|
FocusWidget focusWidget = settingsDialogComponent.getFocusWidget();
|
||||||
|
if (focusWidget != null) {
|
||||||
|
focusWidget.setFocus(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+8
@@ -1,5 +1,6 @@
|
|||||||
package com.sap.sailing.gwt.ui.shared.components;
|
package com.sap.sailing.gwt.ui.shared.components;
|
||||||
|
|
||||||
|
import com.google.gwt.user.client.ui.FocusWidget;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
import com.sap.sailing.gwt.ui.client.DataEntryDialog;
|
import com.sap.sailing.gwt.ui.client.DataEntryDialog;
|
||||||
import com.sap.sailing.gwt.ui.client.DataEntryDialog.Validator;
|
import com.sap.sailing.gwt.ui.client.DataEntryDialog.Validator;
|
||||||
@@ -26,4 +27,11 @@ public interface SettingsDialogComponent<SettingsType> {
|
|||||||
* changes. If <code>null</code> is returned, no validation will be performed.
|
* changes. If <code>null</code> is returned, no validation will be performed.
|
||||||
*/
|
*/
|
||||||
Validator<SettingsType> getValidator();
|
Validator<SettingsType> getValidator();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>null</code> if no initial focus on any widget is desired, or a widget from the
|
||||||
|
* {@link #getAdditionalWidget(DataEntryDialog)} result that will then receive the focus when the settings
|
||||||
|
* dialog is shown
|
||||||
|
*/
|
||||||
|
FocusWidget getFocusWidget();
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user