Bug 4104: Combine all GWT Resource interfaces into one single interface.

This commit is contained in:
Henri Kohlberg committed 2018-09-26 16:00:29 +02:00
1 parent e4ea366a1e
commit 7c20dbe1d2
6 files changed
+20 -42

No files matched your search

@@ -1,16 +0,0 @@
package com.sap.sailing.gwt.ui.raceboard.tagging;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.cellview.client.CellTable;
/**
* Interface for styling cell table containing {@link TagButton} at {@link TagButtonDialog}.
*/
public interface TagButtonCellTableResources extends CellTable.Resources {
public static final TagButtonCellTableResources INSTANCE = GWT.create(TagCellListResources.class);
@Override
@Source("tag-button-celltable.gss")
public CellTable.Style cellTableStyle();
}
@@ -83,7 +83,6 @@ public class TagButtonDialog extends DialogBox {
private final TagPanelResources resources = TagPanelResources.INSTANCE;
private final TagPanelStyle style = resources.style();
private final TagButtonCellTableResources buttonTableResources = GWT.create(TagButtonCellTableResources.class);
private final TaggingPanel taggingPanel;
private final StringMessages stringMessages;
@@ -99,7 +98,8 @@ public class TagButtonDialog extends DialogBox {
* @param footerPanel
* footer panel of {@link TaggingPanel}
*/
public TagButtonDialog(TaggingPanel taggingPanel, TagFooterPanel footerPanel, StringMessages stringMessages, UserService userService) {
public TagButtonDialog(TaggingPanel taggingPanel, TagFooterPanel footerPanel, StringMessages stringMessages,
UserService userService) {
this.taggingPanel = taggingPanel;
this.stringMessages = stringMessages;
@@ -149,7 +149,7 @@ public class TagButtonDialog extends DialogBox {
*/
private CellTable<TagButton> createTable(TagFooterPanel footerPanel, TagInputPanel inputPanel,
TagPreviewPanel tagPreviewPanel) {
CellTable<TagButton> tagButtonTable = new CellTable<TagButton>(15, buttonTableResources);
CellTable<TagButton> tagButtonTable = new CellTable<TagButton>(15, resources);
tagButtonTable.setStyleName(style.tagButtonTable());
// columns
@@ -1,16 +0,0 @@
package com.sap.sailing.gwt.ui.raceboard.tagging;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.cellview.client.CellList;
/**
* Interface for styling {@link TaggingPanel#tagCellList cell list} containing {@link TagCell} at
* {@link TaggingPanel#contentPanel TaggingPanel}.
*/
public interface TagCellListResources extends CellList.Resources {
public static final TagCellListResources INSTANCE = GWT.create(TagCellListResources.class);
@Override
@Source("tag-celllist.gss")
public CellList.Style cellListStyle();
}
@@ -1,14 +1,15 @@
package com.sap.sailing.gwt.ui.raceboard.tagging;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.cellview.client.CellTable;
/**
* Interface for styling {@link TaggingPanel} and its content.
*/
public interface TagPanelResources extends ClientBundle {
public interface TagPanelResources extends CellList.Resources, CellTable.Resources {
public static final TagPanelResources INSTANCE = GWT.create(TagPanelResources.class);
@Source("com/sap/sailing/gwt/ui/client/images/share.png")
@@ -47,6 +48,14 @@ public interface TagPanelResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/plus_transparent.png")
ImageResource plusTransparent();
@Override
@Source("tag-button-celltable.gss")
public CellTable.Style cellTableStyle();
@Override
@Source("tag-celllist.gss")
public CellList.Style cellListStyle();
@Source("tagging-panel.gss")
public TagPanelStyle style();
@@ -17,8 +17,8 @@ import com.sap.sse.security.ui.client.UserService;
*/
public class TagPreviewPanel extends FlowPanel {
private final TagCellListResources cellResources = TagCellListResources.INSTANCE;
private final TagPanelStyle style = TagPanelResources.INSTANCE.style();
private final TagPanelResources resources = TagPanelResources.INSTANCE;
private final TagPanelStyle style = resources.style();
private final TaggingPanel taggingPanel;
private final UserService userService;
@@ -42,7 +42,7 @@ public class TagPreviewPanel extends FlowPanel {
setStyleName(style.tagPreviewPanel());
tagPreviewCellList = new CellList<TagDTO>(new TagCell(taggingPanel, stringMessages, userService, true),
cellResources);
resources);
listContainingPreviewTag = new ArrayList<TagDTO>();
add(new Label(stringMessages.tagPreview()));
add(tagPreviewCellList);
@@ -120,10 +120,11 @@ public class TaggingPanel extends ComponentWithoutSettings
style = TagPanelResources.INSTANCE.style();
style.ensureInjected();
TagCellListResources.INSTANCE.cellListStyle().ensureInjected();
TagPanelResources.INSTANCE.cellListStyle().ensureInjected();
TagPanelResources.INSTANCE.cellTableStyle().ensureInjected();
tagCellList = new CellList<TagDTO>(new TagCell(this, stringMessages, userService, false),
TagCellListResources.INSTANCE);
TagPanelResources.INSTANCE);
tagSelectionModel = new SingleSelectionModel<TagDTO>();
tagListProvider = new TagListProvider();