mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
moved editIcon to sse; implemented first version of a RolesPanel
Change-Id: I1cccf21abb2fcca3619d827a27eda2ca0625f54e
This commit is contained in:
+2
-1
@@ -2,7 +2,8 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.security.shared.PermissionBuilder.Action;
|
||||
|
||||
public abstract class AccessControlledActionsColumn<T, S extends ImagesBarCell> extends ImagesBarColumn<T, S> {
|
||||
|
||||
+4
-1
@@ -31,6 +31,7 @@ import com.sap.sailing.gwt.ui.shared.RegattaDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.SecurityStylesheetResources;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsolePanel;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.adminconsole.DefaultRefreshableAdminConsolePanel;
|
||||
import com.sap.sse.gwt.adminconsole.ReplicationPanel;
|
||||
import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
@@ -48,6 +49,8 @@ import com.sap.sse.security.ui.client.component.UserManagementPanel;
|
||||
import com.sap.sse.security.ui.client.i18n.StringMessages;
|
||||
|
||||
public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint implements RegattaRefresher, LeaderboardsRefresher, LeaderboardGroupsRefresher {
|
||||
private final AdminConsoleTableResources tableResources = GWT.create(AdminConsoleTableResources.class);
|
||||
|
||||
private Set<RegattasDisplayer> regattasDisplayers;
|
||||
private Set<LeaderboardsDisplayer> leaderboardsDisplayers;
|
||||
private Set<LeaderboardGroupsDisplayer> leaderboardGroupsDisplayers;
|
||||
@@ -280,7 +283,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint implements
|
||||
getStringMessages().localServer(), Permission.MANAGE_LOCAL_SERVER_INSTANCE);
|
||||
|
||||
final UserManagementPanel userManagementPanel = new UserManagementPanel(getUserService(), StringMessages.INSTANCE,
|
||||
Arrays.<com.sap.sse.security.shared.Permission>asList(Permission.values()), this);
|
||||
Arrays.<com.sap.sse.security.shared.Permission>asList(Permission.values()), this, tableResources);
|
||||
panel.addToTabPanel(advancedTabPanel,
|
||||
new DefaultRefreshableAdminConsolePanel<UserManagementPanel>(userManagementPanel) {
|
||||
@Override
|
||||
|
||||
-3
@@ -7,9 +7,6 @@ interface AdminConsoleResources extends ClientBundle {
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/settingsActionIcon.png")
|
||||
ImageResource settingsActionIcon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/edit.png")
|
||||
ImageResource editIcon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/import.png")
|
||||
ImageResource importIcon();
|
||||
|
||||
|
||||
+3
-2
@@ -5,7 +5,8 @@ import java.util.Arrays;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class CompetitorConfigImagesBarCell extends ImagesBarCell {
|
||||
static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
@@ -26,7 +27,7 @@ public class CompetitorConfigImagesBarCell extends ImagesBarCell {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REFRESH, stringMessages.reload(), makeImagePrototype(resources.reloadIcon()))
|
||||
);
|
||||
}
|
||||
|
||||
+2
-1
@@ -21,11 +21,12 @@ import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.FlagImageResolverImpl;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.common.CountryCode;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableSelectionModel;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import com.sap.sailing.gwt.ui.shared.WaypointDTO;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableSingleSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class CourseManagementWidgetWaypointsImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_DELETE = "ACTION_DELETE";
|
||||
|
||||
+3
-5
@@ -2,16 +2,14 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
import com.sap.sse.security.shared.PermissionBuilder.DefaultActions;
|
||||
|
||||
public class EventConfigImagesBarCell extends ImagesBarCell {
|
||||
private final StringMessages stringMessages;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
public EventConfigImagesBarCell(StringMessages stringMessages) {
|
||||
super();
|
||||
@@ -26,8 +24,8 @@ public class EventConfigImagesBarCell extends ImagesBarCell {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(
|
||||
new ImageSpec(DefaultActions.EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
new ImageSpec(DefaultActions.REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon()))
|
||||
new ImageSpec(DefaultActions.EDIT.name(), stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(DefaultActions.REMOVE.name(), stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon()))
|
||||
);
|
||||
}
|
||||
}
|
||||
Regular → Executable
+3
-3
@@ -32,13 +32,14 @@ import com.google.gwt.view.client.ListDataProvider;
|
||||
import com.sap.sailing.expeditionconnector.ExpeditionDeviceConfiguration;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.BaseCelltable;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableSingleSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
@@ -50,7 +51,6 @@ public class ExpeditionDeviceConfigurationsPanel extends FlowPanel {
|
||||
private final CellTable<ExpeditionDeviceConfiguration> allDeviceConfigurations;
|
||||
private final LabeledAbstractFilterablePanel<ExpeditionDeviceConfiguration> filterDeviceConfigurationsPanel;
|
||||
private final RefreshableSingleSelectionModel<ExpeditionDeviceConfiguration> refreshableDeviceConfigurationsSelectionModel;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
public static class DeviceConfigurationImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
@@ -70,7 +70,7 @@ public class ExpeditionDeviceConfigurationsPanel extends FlowPanel {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon())));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -36,12 +36,13 @@ import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent.Handler;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.BaseCelltable;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableSingleSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
|
||||
+2
-4
@@ -2,17 +2,15 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class ImageConfigImagesBarCell extends ImagesBarCell {
|
||||
static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
private final StringMessages stringMessages;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
public ImageConfigImagesBarCell(StringMessages stringMessages) {
|
||||
super();
|
||||
@@ -27,7 +25,7 @@ public class ImageConfigImagesBarCell extends ImagesBarCell {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon()))
|
||||
);
|
||||
}
|
||||
|
||||
+1
@@ -34,6 +34,7 @@ import com.sap.sse.common.media.MediaTagConstants;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.celltable.BaseCelltable;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.media.ImageDTO;
|
||||
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ import java.util.Arrays;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class LeaderboardConfigImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
@@ -33,7 +33,7 @@ public class LeaderboardConfigImagesBarCell extends ImagesBarCell {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_EDIT_SCORES, stringMessages.actionEditScores(), makeImagePrototype(resources.scoresIcon())),
|
||||
new ImageSpec(ACTION_EDIT_COMPETITORS, stringMessages.actionEditCompetitors(), makeImagePrototype(resources.competitorsIcon())),
|
||||
new ImageSpec(ACTION_CONFIGURE_URL, stringMessages.actionConfigureUrl(), makeImagePrototype(resources.settingsActionIcon())),
|
||||
|
||||
+1
@@ -68,6 +68,7 @@ import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.SelectionCheckboxColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.shared.components.LinkWithSettingsGenerator;
|
||||
|
||||
+2
-4
@@ -2,16 +2,14 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class LeaderboardGroupConfigImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
public static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
private final StringMessages stringMessages;
|
||||
|
||||
public LeaderboardGroupConfigImagesBarCell(StringMessages stringMessages) {
|
||||
@@ -26,7 +24,7 @@ public class LeaderboardGroupConfigImagesBarCell extends ImagesBarCell {
|
||||
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon())));
|
||||
}
|
||||
}
|
||||
+1
@@ -57,6 +57,7 @@ import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.URLEncoder;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
|
||||
import com.sap.sse.gwt.client.celltable.SelectionCheckboxColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class LeaderboardRaceConfigImagesBarCell extends ImagesBarCell {
|
||||
public final static String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
@@ -31,7 +31,7 @@ public class LeaderboardRaceConfigImagesBarCell extends ImagesBarCell {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
List<ImageSpec> result = new ArrayList<ImageSpec>();
|
||||
result.add(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())));
|
||||
result.add(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())));
|
||||
result.add(new ImageSpec(ACTION_UNLINK, stringMessages.actionRaceUnlink(), makeImagePrototype(resources.unlinkIcon())));
|
||||
StrippedLeaderboardDTO selectedLeaderboard = selectedLeaderboardProvider.getSelectedLeaderboard();
|
||||
if (selectedLeaderboard != null && !selectedLeaderboard.type.isRegattaLeaderboard()) {
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class MediaActionBarCell extends ImagesBarCell {
|
||||
|
||||
|
||||
+1
@@ -58,6 +58,7 @@ import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.celltable.BaseCelltable;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableSingleSelectionModel;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ import com.sap.sailing.gwt.ui.shared.RaceCourseDTO;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
|
||||
public class RaceLogCourseManagementWidget extends CourseManagementWidget {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class RaceLogTrackingCourseDefinitionDialogMarksImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_PING = "ACTION_PING";
|
||||
|
||||
+1
-1
@@ -4,9 +4,9 @@ import java.util.ArrayList;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sailing.gwt.ui.shared.DeviceMappingDTO;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class RaceLogTrackingDeviceMappingsImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_CLOSE = "CLOSE";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class RaceLogTrackingEventManagementImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_DENOTE_FOR_RACELOG_TRACKING = "ACTION_DENOTE_FOR_RACELOG_TRACKING";
|
||||
|
||||
+3
-2
@@ -7,8 +7,9 @@ import com.google.gwt.core.client.GWT;
|
||||
import com.sap.sailing.domain.common.abstractlog.TimePointSpecificationFoundInLog;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.AbstractLeaderboardConfigPanel.RaceColumnDTOAndFleetDTOWithNameBasedEquality;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class RaceLogTrackingEventManagementRaceImagesBarCell extends ImagesBarCell {
|
||||
public final static String ACTION_DENOTE_FOR_RACELOG_TRACKING = "ACTION_DENOTE_FOR_RACELOG_TRACKING";
|
||||
@@ -48,7 +49,7 @@ public class RaceLogTrackingEventManagementRaceImagesBarCell extends ImagesBarCe
|
||||
result.add(new ImageSpec(ACTION_DEFINE_COURSE, stringMessages.defineCourse(), makeImagePrototype(resources.defineCourse())));
|
||||
result.add(new ImageSpec(ACTION_COPY, stringMessages.copyCourseAndCompetitors(), makeImagePrototype(resources.copy())));
|
||||
}
|
||||
result.add(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())));
|
||||
result.add(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())));
|
||||
result.add(new ImageSpec(ACTION_REFRESH_RACELOG, stringMessages.refreshRaceLog(), makeImagePrototype(resources.reloadIcon())));
|
||||
result.add(new ImageSpec(ACTION_SET_STARTTIME, stringMessages.setStartTime(), makeImagePrototype(resources.clockIcon())));
|
||||
result.add(new ImageSpec(ACTION_SET_FINISHING_AND_FINISH_TIME, stringMessages.setFinishingAndFinishTime(), makeImagePrototype(resources.blueSmall())));
|
||||
|
||||
+2
-4
@@ -2,17 +2,15 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class RegattaConfigImagesBarCell extends ImagesBarCell {
|
||||
static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
public static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
private final StringMessages stringMessages;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
public RegattaConfigImagesBarCell(StringMessages stringConstants) {
|
||||
super();
|
||||
@@ -26,7 +24,7 @@ public class RegattaConfigImagesBarCell extends ImagesBarCell {
|
||||
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon())));
|
||||
}
|
||||
}
|
||||
+1
@@ -38,6 +38,7 @@ import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.celltable.BaseCelltable;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
|
||||
|
||||
|
||||
+1
@@ -42,6 +42,7 @@ import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
|
||||
import com.sap.sse.gwt.client.celltable.SelectionCheckboxColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
|
||||
+1
@@ -43,6 +43,7 @@ import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.TypedDeviceMappingDTO;
|
||||
import com.sap.sse.common.filter.Filter;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
|
||||
|
||||
+2
-4
@@ -2,17 +2,15 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class SeriesConfigImagesBarCell extends ImagesBarCell {
|
||||
static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
private final StringMessages stringMessages;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
public SeriesConfigImagesBarCell(StringMessages stringConstants) {
|
||||
super();
|
||||
@@ -26,7 +24,7 @@ public class SeriesConfigImagesBarCell extends ImagesBarCell {
|
||||
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon())));
|
||||
}
|
||||
}
|
||||
+1
@@ -65,6 +65,7 @@ import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.SelectionCheckboxColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
|
||||
+2
-4
@@ -2,17 +2,15 @@ package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
|
||||
public class VideoConfigImagesBarCell extends ImagesBarCell {
|
||||
static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
private final StringMessages stringMessages;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
|
||||
public VideoConfigImagesBarCell(StringMessages stringMessages) {
|
||||
super();
|
||||
@@ -27,7 +25,7 @@ public class VideoConfigImagesBarCell extends ImagesBarCell {
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(resources.editIcon())),
|
||||
new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon()))
|
||||
);
|
||||
}
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ import com.sap.sse.common.media.MediaTagConstants;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsoleTableResources;
|
||||
import com.sap.sse.gwt.client.celltable.BaseCelltable;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.media.VideoDTO;
|
||||
|
||||
|
||||
+4
-2
@@ -1,9 +1,11 @@
|
||||
package com.sap.sse.gwt.adminconsole;
|
||||
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
import com.sap.sse.security.ui.client.SecurityTableResources;
|
||||
import com.sap.sse.security.ui.client.SecurityTableStyle;
|
||||
|
||||
public interface AdminConsoleTableResources extends CellTable.Resources {
|
||||
interface AdminConsoleTableStyle extends CellTable.Style {
|
||||
public interface AdminConsoleTableResources extends SecurityTableResources, CellTable.Resources {
|
||||
interface AdminConsoleTableStyle extends SecurityTableStyle, CellTable.Style {
|
||||
/**
|
||||
* Applied to header cells of race columns
|
||||
*/
|
||||
|
||||
Regular → Executable
|
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
@@ -10,4 +10,7 @@ public interface IconResources extends ClientBundle {
|
||||
|
||||
@Source("images/remove.png")
|
||||
ImageResource removeIcon();
|
||||
|
||||
@Source("images/edit.png")
|
||||
ImageResource editIcon();
|
||||
}
|
||||
|
||||
+1
-5
@@ -1,4 +1,4 @@
|
||||
package com.sap.sailing.gwt.ui.client.shared.controls;
|
||||
package com.sap.sse.gwt.client.celltable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -20,7 +20,6 @@ import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.google.gwt.text.shared.SimpleSafeHtmlRenderer;
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||
import com.sap.sse.security.shared.PermissionBuilder.Action;
|
||||
|
||||
/**
|
||||
* A cell type for use in a {@link CellTable} which renders a horizontal sequence of images. Use by subclassing and
|
||||
@@ -41,9 +40,6 @@ public abstract class ImagesBarCell extends AbstractSafeHtmlCell<String> {
|
||||
private final AbstractImagePrototype imagePrototype;
|
||||
private final String actionName;
|
||||
private final String tooltip;
|
||||
public ImageSpec(Action action, String tooltip, AbstractImagePrototype imagePrototype) {
|
||||
this(action.name(), tooltip, imagePrototype);
|
||||
}
|
||||
public ImageSpec(String actionName, String tooltip, AbstractImagePrototype imagePrototype) {
|
||||
super();
|
||||
this.imagePrototype = imagePrototype;
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
package com.sap.sse.gwt.client.celltable;
|
||||
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.ImagesBarCell;
|
||||
|
||||
public class ImagesBarColumn<T, S extends ImagesBarCell> extends Column<T, String> {
|
||||
public ImagesBarColumn(S imagesBarCell) {
|
||||
@@ -26,12 +26,12 @@ import com.sap.sse.gwt.client.celltable.RefreshableSingleSelectionModel;
|
||||
|
||||
/**
|
||||
* This Panel contains a text box. Text entered into the text box filters the {@link CellTable} passed to the
|
||||
* constructor by adjusting the cell table's {@link ListDataProvider}'s contents using the {@link applyFilter(String,
|
||||
* List)} of the {@link AbstractListFilter} and then sorting the table again according the the sorting criteria
|
||||
* currently active (the sorting is the only reason why the {@link CellTable} actually needs to be known to an instance
|
||||
* of this class). To be initiated the method {@link #getSearchableStrings(Object)} has to be defined, which gets those
|
||||
* Strings from a <code>T</code> that should be considered when filtering, e.g. name or boatClass. The cell table can be
|
||||
* sorted independently from the text box (e.g., after adding new objects) by calling the method
|
||||
* constructor by adjusting the cell table's {@link ListDataProvider}'s contents using the
|
||||
* {@link AbstractListFilter#applyFilter(String, List)} and then sorting the table again according the the sorting
|
||||
* criteria currently active (the sorting is the only reason why the {@link CellTable} actually needs to be known to an
|
||||
* instance of this class). To be initiated the method {@link #getSearchableStrings(Object)} has to be defined, which
|
||||
* gets those Strings from a <code>T</code> that should be considered when filtering, e.g. name or boatClass. The cell
|
||||
* table can be sorted independently from the text box (e.g., after adding new objects) by calling the method
|
||||
* {@link #updateAll(Iterable)} which then runs the filter over the new selection.
|
||||
* <p>
|
||||
*
|
||||
|
||||
+16
-13
@@ -7,24 +7,26 @@ import com.sap.sse.common.filter.AbstractListFilter;
|
||||
|
||||
/**
|
||||
* This Panel contains a label and a text box. Text entered into the text box filters the {@link CellTable} passed to
|
||||
* the constructor by adjusting the cell table's {@link ListDataProvider}'s contents using the {@link
|
||||
* applyFilter(String, List)} of the {@link AbstractListFilter} and then sorting the table again according the the
|
||||
* sorting criteria currently active (the sorting is the only reason why the {@link CellTable} actually needs to be
|
||||
* known to an instance of this class). To be initiated the method {@link #getSearchableStrings(Object)} has to be
|
||||
* defined, which gets those Strings from a <code>T</code> that should be considered when filtering, e.g. name or
|
||||
* boatClass. The cell table can be sorted independently from the text box (e.g. after adding new objects) by calling
|
||||
* the method {@link #updateAll(Iterable)} which then runs the filter over the new selection.</p>
|
||||
* the constructor by adjusting the cell table's {@link ListDataProvider}'s contents using the
|
||||
* {@link AbstractListFilter#applyFilter(String, List)} of the {@link AbstractListFilter} and then sorting the table
|
||||
* again according the the sorting criteria currently active (the sorting is the only reason why the {@link CellTable}
|
||||
* actually needs to be known to an instance of this class). To be initiated the method
|
||||
* {@link #getSearchableStrings(Object)} has to be defined, which gets those Strings from a <code>T</code> that should
|
||||
* be considered when filtering, e.g. name or boatClass. The cell table can be sorted independently from the text box
|
||||
* (e.g. after adding new objects) by calling the method {@link #updateAll(Iterable)} which then runs the filter over
|
||||
* the new selection.
|
||||
* </p>
|
||||
*
|
||||
* Note that this panel does <em>not</em> contain the table that it filters. With this, this class's clients are free
|
||||
* to position the table wherever they want, not necessarily related to the text box provided by this panel in any
|
||||
* specific way.
|
||||
* Note that this panel does <em>not</em> contain the table that it filters. With this, this class's clients are free to
|
||||
* position the table wherever they want, not necessarily related to the text box provided by this panel in any specific
|
||||
* way.
|
||||
*
|
||||
* @param <T>
|
||||
* @author Nicolas Klose, Axel Uhl
|
||||
*
|
||||
*/
|
||||
public abstract class LabeledAbstractFilterablePanel<T> extends AbstractFilterablePanel<T> {
|
||||
|
||||
|
||||
/**
|
||||
* @param display
|
||||
* Note: when using this with a cell table obtained through {@link TableWrapper#getTable()}, obtain this
|
||||
@@ -32,9 +34,10 @@ public abstract class LabeledAbstractFilterablePanel<T> extends AbstractFilterab
|
||||
* {@link TableWrapper#registerSelectionModelOnNewDataProvider} method so that the selection is preserved
|
||||
* across setting and removing the filter
|
||||
*/
|
||||
public LabeledAbstractFilterablePanel(Label label, Iterable<T> all, CellTable<T> display, final ListDataProvider<T> filtered) {
|
||||
public LabeledAbstractFilterablePanel(Label label, Iterable<T> all, CellTable<T> display,
|
||||
final ListDataProvider<T> filtered) {
|
||||
super(all, display, filtered);
|
||||
insert(label, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-3
@@ -34,7 +34,4 @@ public interface IconResources extends ClientBundle {
|
||||
|
||||
@Source("images/status_grey.png")
|
||||
ImageResource statusGrey();
|
||||
|
||||
@Source("images/delete.png")
|
||||
ImageResource delete();
|
||||
}
|
||||
|
||||
java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/SecurityTableResources.css
Executable
+20
@@ -0,0 +1,20 @@
|
||||
.cellTableCheckboxColumnCell {
|
||||
}
|
||||
|
||||
.cellTableCheckboxSelected {
|
||||
height: 13px;
|
||||
width: 13px;
|
||||
margin: auto auto;
|
||||
/* border: 1px solid #fcbb22; */
|
||||
/* background-color: #fcbb22; */
|
||||
border: solid 1px #acacac;
|
||||
background-color: #cacaca;
|
||||
|
||||
}
|
||||
|
||||
.cellTableCheckboxDeselected {
|
||||
height: 13px;
|
||||
width: 13px;
|
||||
margin: auto auto;
|
||||
border: solid 1px #acacac;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.sap.sse.security.ui.client;
|
||||
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
|
||||
public interface SecurityTableResources extends CellTable.Resources {
|
||||
@Override
|
||||
@Source({CellTable.Style.DEFAULT_CSS, "com/sap/sse/security/ui/client/SecurityTableResources.css"})
|
||||
SecurityTableStyle cellTableStyle();
|
||||
}
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
package com.sap.sse.security.ui.client;
|
||||
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
|
||||
public interface SecurityTableStyle extends CellTable.Style {
|
||||
/**
|
||||
* Applied to checkbox column
|
||||
*/
|
||||
String cellTableCheckboxColumnCell();
|
||||
|
||||
/**
|
||||
* Applied to the checkbox div when the checkbox is selected
|
||||
*/
|
||||
String cellTableCheckboxSelected();
|
||||
|
||||
/**
|
||||
* Applied to the checkbox div when the checkbox is deselected
|
||||
*/
|
||||
String cellTableCheckboxDeselected();
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.sap.sse.security.ui.client.component;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.gwt.text.shared.SafeHtmlRenderer;
|
||||
import com.sap.sse.gwt.client.IconResources;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarCell;
|
||||
import com.sap.sse.security.ui.client.i18n.StringMessages;
|
||||
|
||||
public class RoleImagesBarCell extends ImagesBarCell {
|
||||
static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
public static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
private final StringMessages stringMessages;
|
||||
|
||||
public RoleImagesBarCell(StringMessages stringMessages) {
|
||||
super();
|
||||
this.stringMessages = stringMessages;
|
||||
}
|
||||
|
||||
public RoleImagesBarCell(SafeHtmlRenderer<String> renderer, StringMessages stringMessages) {
|
||||
this(stringMessages);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<ImageSpec> getImageSpecs() {
|
||||
return Arrays.asList(new ImageSpec(ACTION_EDIT, stringMessages.actionEdit(), makeImagePrototype(IconResources.INSTANCE.editIcon())),
|
||||
new ImageSpec(ACTION_REMOVE, stringMessages.actionRemove(), makeImagePrototype(IconResources.INSTANCE.removeIcon())));
|
||||
}
|
||||
}
|
||||
+179
-4
@@ -1,10 +1,39 @@
|
||||
package com.sap.sse.security.ui.client.component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gwt.cell.client.FieldUpdater;
|
||||
import com.google.gwt.cell.client.SafeHtmlCell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler;
|
||||
import com.google.gwt.user.cellview.client.TextColumn;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.view.client.ListDataProvider;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.celltable.EntityIdentityComparator;
|
||||
import com.sap.sse.gwt.client.celltable.FlushableSortedCellTableWithStylableHeaders;
|
||||
import com.sap.sse.gwt.client.celltable.ImagesBarColumn;
|
||||
import com.sap.sse.gwt.client.celltable.RefreshableMultiSelectionModel;
|
||||
import com.sap.sse.gwt.client.celltable.SelectionCheckboxColumn;
|
||||
import com.sap.sse.gwt.client.panels.LabeledAbstractFilterablePanel;
|
||||
import com.sap.sse.security.shared.Role;
|
||||
import com.sap.sse.security.shared.WildcardPermission;
|
||||
import com.sap.sse.security.ui.client.SecurityTableResources;
|
||||
import com.sap.sse.security.ui.client.UserManagementServiceAsync;
|
||||
import com.sap.sse.security.ui.client.i18n.StringMessages;
|
||||
|
||||
@@ -18,16 +47,162 @@ import com.sap.sse.security.ui.client.i18n.StringMessages;
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public class RolesPanel extends FlowPanel {
|
||||
public class RolesPanel extends VerticalPanel {
|
||||
private final Button addButton;
|
||||
private final Button removeButton;
|
||||
private final Button refreshButton;
|
||||
private final FlushableSortedCellTableWithStylableHeaders<Role> rolesTable;
|
||||
private final ErrorReporter errorReporter;
|
||||
private final UserManagementServiceAsync userManagementService;
|
||||
private final ListDataProvider<Role> rolesListDataProvider;
|
||||
private final List<Role> allRoles;
|
||||
private final StringMessages stringMessages;
|
||||
private final LabeledAbstractFilterablePanel<Role> filterablePanelRoles;
|
||||
private RefreshableMultiSelectionModel<? super Role> refreshableRoleMultiSelectionModel;
|
||||
|
||||
public RolesPanel(StringMessages stringMessages, UserManagementServiceAsync userManagementService, CellTable.Resources tableResources) {
|
||||
public RolesPanel(StringMessages stringMessages, UserManagementServiceAsync userManagementService, SecurityTableResources tableResources,
|
||||
ErrorReporter errorReporter) {
|
||||
this.errorReporter = errorReporter;
|
||||
this.stringMessages = stringMessages;
|
||||
this.userManagementService = userManagementService;
|
||||
this.addButton = new Button(stringMessages.add());
|
||||
this.removeButton = new Button(stringMessages.remove());
|
||||
this.refreshButton = new Button(stringMessages.refresh());
|
||||
this.rolesTable = new FlushableSortedCellTableWithStylableHeaders<>(/* pageSize */ 50, tableResources);
|
||||
this.allRoles = new ArrayList<>();
|
||||
rolesListDataProvider = new ListDataProvider<Role>();
|
||||
filterablePanelRoles = new LabeledAbstractFilterablePanel<Role>(new Label(stringMessages.filterRoles()), allRoles,
|
||||
new CellTable<Role>(), rolesListDataProvider) {
|
||||
@Override
|
||||
public Iterable<String> getSearchableStrings(Role role) {
|
||||
return Arrays.asList(role.getName(), role.getId().toString(), role.getPermissions().toString());
|
||||
}
|
||||
};
|
||||
filterablePanelRoles.getTextBox().ensureDebugId("RolesFilterTextBox");
|
||||
rolesTable = createRolesTable(tableResources);
|
||||
rolesTable.ensureDebugId("RolesCellTable");
|
||||
filterablePanelRoles.setTable(rolesTable);
|
||||
refreshableRoleMultiSelectionModel = (RefreshableMultiSelectionModel<? super Role>) rolesTable.getSelectionModel();
|
||||
removeButton.addClickHandler(e->{
|
||||
final Set<Role> selectedRoles = new HashSet<Role>(getSelectedRoles());
|
||||
filterablePanelRoles.removeAll(selectedRoles);
|
||||
});
|
||||
refreshButton.addClickHandler(e->updateRoles());
|
||||
final HorizontalPanel buttonPanel = new HorizontalPanel();
|
||||
buttonPanel.add(refreshButton);
|
||||
buttonPanel.add(addButton);
|
||||
buttonPanel.add(removeButton);
|
||||
add(buttonPanel);
|
||||
add(filterablePanelRoles);
|
||||
add(rolesTable);
|
||||
updateRoles();
|
||||
}
|
||||
|
||||
private Set<Role> getSelectedRoles() {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Set<Role> result = (Set<Role>) refreshableRoleMultiSelectionModel.getSelectedSet();
|
||||
return result;
|
||||
}
|
||||
|
||||
private FlushableSortedCellTableWithStylableHeaders<Role> createRolesTable(SecurityTableResources tableResources) {
|
||||
final FlushableSortedCellTableWithStylableHeaders<Role> table = new FlushableSortedCellTableWithStylableHeaders<>(/* pageSize */ 50, tableResources);
|
||||
rolesListDataProvider.addDataDisplay(table);
|
||||
table.setWidth("100%");
|
||||
SelectionCheckboxColumn<Role> roleSelectionCheckboxColumn = new SelectionCheckboxColumn<Role>(
|
||||
tableResources.cellTableStyle().cellTableCheckboxSelected(),
|
||||
tableResources.cellTableStyle().cellTableCheckboxDeselected(),
|
||||
tableResources.cellTableStyle().cellTableCheckboxColumnCell(), new EntityIdentityComparator<Role>() {
|
||||
@Override
|
||||
public boolean representSameEntity(Role role1, Role role2) {
|
||||
return role1.getId().equals(role2.getId());
|
||||
}
|
||||
@Override
|
||||
public int hashCode(Role t) {
|
||||
return t.getId().hashCode();
|
||||
}
|
||||
}, filterablePanelRoles.getAllListDataProvider(), table);
|
||||
ListHandler<Role> columnSortHandler = new ListHandler<>(rolesListDataProvider.getList());
|
||||
table.addColumnSortHandler(columnSortHandler);
|
||||
columnSortHandler.setComparator(roleSelectionCheckboxColumn, roleSelectionCheckboxColumn.getComparator());
|
||||
|
||||
TextColumn<Role> roleNameColumn = new TextColumn<Role>() {
|
||||
@Override
|
||||
public String getValue(Role role) {
|
||||
return role.getName();
|
||||
}
|
||||
};
|
||||
roleNameColumn.setSortable(true);
|
||||
columnSortHandler.setComparator(roleNameColumn, new Comparator<Role>() {
|
||||
@Override
|
||||
public int compare(Role r1, Role r2) {
|
||||
return new NaturalComparator().compare(r1.getName(), r2.getName());
|
||||
}
|
||||
});
|
||||
|
||||
Column<Role, SafeHtml> permissionsColumn = new Column<Role, SafeHtml>(new SafeHtmlCell()) {
|
||||
@Override
|
||||
public SafeHtml getValue(Role role) {
|
||||
SafeHtmlBuilder builder = new SafeHtmlBuilder();
|
||||
for (Iterator<WildcardPermission> permissionIter=role.getPermissions().iterator(); permissionIter.hasNext(); ) {
|
||||
final WildcardPermission permission = permissionIter.next();
|
||||
builder.appendEscaped(permission.toString());
|
||||
if (permissionIter.hasNext()) {
|
||||
builder.appendHtmlConstant("<br>");
|
||||
}
|
||||
}
|
||||
return builder.toSafeHtml();
|
||||
}
|
||||
};
|
||||
permissionsColumn.setSortable(true);
|
||||
columnSortHandler.setComparator(permissionsColumn, new Comparator<Role>() {
|
||||
@Override
|
||||
public int compare(Role r1, Role r2) {
|
||||
return new NaturalComparator().compare(r1.getPermissions().toString(), r2.getPermissions().toString());
|
||||
}
|
||||
});
|
||||
ImagesBarColumn<Role, RoleImagesBarCell> regattaActionColumn = new ImagesBarColumn<Role, RoleImagesBarCell>(
|
||||
new RoleImagesBarCell(stringMessages));
|
||||
regattaActionColumn.setFieldUpdater(new FieldUpdater<Role, String>() {
|
||||
@Override
|
||||
public void update(int index, Role role, String value) {
|
||||
if (RoleImagesBarCell.ACTION_EDIT.equals(value)) {
|
||||
editRole(role);
|
||||
} else if (RoleImagesBarCell.ACTION_REMOVE.equals(value)) {
|
||||
if (Window.confirm(stringMessages.doYouReallyWantToRemoveRole(role.getName()))) {
|
||||
removeRole(role);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
table.addColumn(roleSelectionCheckboxColumn, roleSelectionCheckboxColumn.getHeader());
|
||||
table.addColumn(roleNameColumn, stringMessages.name());
|
||||
table.addColumn(permissionsColumn, stringMessages.permissions());
|
||||
table.addColumn(regattaActionColumn, stringMessages.actions());
|
||||
table.setSelectionModel(roleSelectionCheckboxColumn.getSelectionModel(), roleSelectionCheckboxColumn.getSelectionManager());
|
||||
return table;
|
||||
}
|
||||
|
||||
private void removeRole(Role role) {
|
||||
// TODO Auto-generated method stub
|
||||
Window.alert("Remove "+role);
|
||||
}
|
||||
|
||||
private void editRole(Role role) {
|
||||
// TODO Auto-generated method stub
|
||||
Window.alert("Edit "+role);
|
||||
}
|
||||
|
||||
public void updateRoles() {
|
||||
userManagementService.getRoles(new AsyncCallback<ArrayList<Role>>() {
|
||||
@Override
|
||||
public void onSuccess(ArrayList<Role> allRoles) {
|
||||
filterablePanelRoles.updateAll(allRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
errorReporter.reportError(stringMessages.errorTryingToLoadRoles(caught.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -173,7 +173,7 @@ public class SettingsPanel extends LayoutPanel {
|
||||
|
||||
flexTable.setWidget(row, 2, statusGreen);
|
||||
|
||||
final ImageResource deleteImageResource = IconResources.INSTANCE.delete();
|
||||
final ImageResource deleteImageResource = com.sap.sse.gwt.client.IconResources.INSTANCE.removeIcon();
|
||||
HTML delete = new HTML(renderer.render(deleteImageResource));
|
||||
delete.addClickHandler(new ClickHandler() {
|
||||
|
||||
@@ -283,7 +283,7 @@ public class SettingsPanel extends LayoutPanel {
|
||||
|
||||
flexTable.setWidget(row, 3, statusGreen);
|
||||
|
||||
final ImageResource deleteImageResource = IconResources.INSTANCE.delete();
|
||||
final ImageResource deleteImageResource = com.sap.sse.gwt.client.IconResources.INSTANCE.removeIcon();
|
||||
HTML delete = new HTML(renderer.render(deleteImageResource));
|
||||
delete.addClickHandler(new ClickHandler() {
|
||||
|
||||
|
||||
+18
-10
@@ -29,6 +29,7 @@ import com.google.gwt.view.client.SingleSelectionModel;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.security.shared.AccessControlList;
|
||||
import com.sap.sse.security.shared.Permission;
|
||||
import com.sap.sse.security.ui.client.SecurityTableResources;
|
||||
import com.sap.sse.security.ui.client.UserChangeEventHandler;
|
||||
import com.sap.sse.security.ui.client.UserManagementServiceAsync;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
@@ -38,23 +39,26 @@ import com.sap.sse.security.ui.shared.UserDTO;
|
||||
|
||||
public class UserManagementPanel extends DockPanel {
|
||||
|
||||
private List<UserCreatedEventHandler> userCreatedHandlers = new ArrayList<>();
|
||||
private final List<UserCreatedEventHandler> userCreatedHandlers = new ArrayList<>();
|
||||
|
||||
private List<UserDeletedEventHandler> userDeletedHandlers = new ArrayList<>();
|
||||
private final List<UserDeletedEventHandler> userDeletedHandlers = new ArrayList<>();
|
||||
|
||||
private SingleSelectionModel<AccessControlList> aclSingleSelectionModel;
|
||||
private AccessControlListListDataProvider aclListDataProvider;
|
||||
private final SingleSelectionModel<AccessControlList> aclSingleSelectionModel;
|
||||
private final AccessControlListListDataProvider aclListDataProvider;
|
||||
|
||||
private SingleSelectionModel<UserDTO> singleSelectionModel;
|
||||
private final SingleSelectionModel<UserDTO> singleSelectionModel;
|
||||
|
||||
private UserListDataProvider userListDataProvider;
|
||||
private final UserListDataProvider userListDataProvider;
|
||||
|
||||
public UserManagementPanel(final UserService userService, final StringMessages stringMessages, ErrorReporter errorReporter) {
|
||||
this(userService, stringMessages, Collections.<Permission>emptySet(), errorReporter);
|
||||
private final RolesPanel rolesPanel;
|
||||
|
||||
public UserManagementPanel(final UserService userService, final StringMessages stringMessages,
|
||||
ErrorReporter errorReporter, SecurityTableResources tableResources) {
|
||||
this(userService, stringMessages, Collections.<Permission>emptySet(), errorReporter, tableResources);
|
||||
}
|
||||
|
||||
public UserManagementPanel(final UserService userService, final StringMessages stringMessages,
|
||||
Iterable<Permission> additionalPermissions, ErrorReporter errorReporter) {
|
||||
Iterable<Permission> additionalPermissions, ErrorReporter errorReporter, SecurityTableResources tableResources) {
|
||||
final UserManagementServiceAsync userManagementService = userService.getUserManagementService();
|
||||
VerticalPanel west = new VerticalPanel();
|
||||
HorizontalPanel buttonPanel = new HorizontalPanel();
|
||||
@@ -133,13 +137,16 @@ public class UserManagementPanel extends DockPanel {
|
||||
west.add(aclPager);
|
||||
west.add(aclPanel);
|
||||
|
||||
rolesPanel = new RolesPanel(stringMessages, userManagementService, tableResources, errorReporter);
|
||||
add(rolesPanel, DockPanel.CENTER);
|
||||
|
||||
final UserList userList = new UserList();
|
||||
userList.setSelectionModel(singleSelectionModel);
|
||||
TextBox filterBox = new TextBox();
|
||||
userListDataProvider = new UserListDataProvider(userManagementService, filterBox);
|
||||
final UserDetailsView userDetailsView = new UserDetailsView(userService,
|
||||
singleSelectionModel.getSelectedObject(), stringMessages, userListDataProvider, additionalPermissions, errorReporter);
|
||||
add(userDetailsView, DockPanel.CENTER);
|
||||
add(userDetailsView, DockPanel.EAST);
|
||||
userDetailsView.addUserChangeEventHandler(new UserChangeEventHandler() {
|
||||
@Override
|
||||
public void onUserChange(UserDTO user) {
|
||||
@@ -199,6 +206,7 @@ public class UserManagementPanel extends DockPanel {
|
||||
public void updateUsersAndACLs() {
|
||||
userListDataProvider.updateDisplays();
|
||||
aclListDataProvider.updateDisplays();
|
||||
rolesPanel.updateRoles();
|
||||
}
|
||||
|
||||
public void addUserCreatedEventHandler(UserCreatedEventHandler handler){
|
||||
|
||||
+6
@@ -115,4 +115,10 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages {
|
||||
String id();
|
||||
String displayName();
|
||||
String tenants();
|
||||
String errorTryingToLoadRoles(String message);
|
||||
String filterRoles();
|
||||
String actions();
|
||||
String actionEdit();
|
||||
String actionRemove();
|
||||
String doYouReallyWantToRemoveRole(String name);
|
||||
}
|
||||
|
||||
+7
-1
@@ -119,4 +119,10 @@ couldNotDeleteTenant=Could not delete tenant.
|
||||
filterTenants=Filter tenants...
|
||||
id=ID
|
||||
displayName=Display Name
|
||||
tenants=Tenants
|
||||
tenants=Tenants
|
||||
errorTryingToLoadRoles=Error trying to load roles: {0}
|
||||
filterRoles=Filter roles
|
||||
actions=Actions
|
||||
actionEdit=Edit
|
||||
actionRemove=Remove
|
||||
doYouReallyWantToRemoveRole=Do you really want to remove role "{0}"?
|
||||
+7
-1
@@ -119,4 +119,10 @@ couldNotDeleteTenant=Mandant konnte nicht entfernt werden.
|
||||
filterTenants=Mandanten filtern...
|
||||
id=ID
|
||||
displayName=Anzeigename
|
||||
tenants=Mandanten
|
||||
tenants=Mandanten
|
||||
errorTryingToLoadRoles=Fehler beim Versuch, die Rollen zu laden: {0}
|
||||
filterRoles=Rollen filtern
|
||||
actions=Aktionen
|
||||
actionEdit=Bearbeiten
|
||||
actionRemove=Löschen
|
||||
doYouReallyWantToRemoveRole=Rolle "{0}" wirklich löschen?
|
||||
+5
-1
@@ -1,5 +1,6 @@
|
||||
package com.sap.sse.security.ui.usermanagement;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||
@@ -8,6 +9,7 @@ import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.TabLayoutPanel;
|
||||
import com.sap.sse.security.ui.client.AbstractSecurityEntryPoint;
|
||||
import com.sap.sse.security.ui.client.Resources;
|
||||
import com.sap.sse.security.ui.client.SecurityTableResources;
|
||||
import com.sap.sse.security.ui.client.UserStatusEventHandler;
|
||||
import com.sap.sse.security.ui.client.component.SettingsPanel;
|
||||
import com.sap.sse.security.ui.client.component.UserManagementPanel;
|
||||
@@ -15,6 +17,8 @@ import com.sap.sse.security.ui.loginpanel.LoginPanel;
|
||||
import com.sap.sse.security.ui.shared.UserDTO;
|
||||
|
||||
public class UserManagementEntryPoint extends AbstractSecurityEntryPoint {
|
||||
private final SecurityTableResources tableResources = GWT.create(SecurityTableResources.class);
|
||||
|
||||
private TabLayoutPanel center;
|
||||
|
||||
@Override
|
||||
@@ -26,7 +30,7 @@ public class UserManagementEntryPoint extends AbstractSecurityEntryPoint {
|
||||
public void onUserStatusChange(UserDTO user, boolean preAuthenticated) {
|
||||
}
|
||||
});
|
||||
UserManagementPanel userManagementPanel = new UserManagementPanel(getUserService(), getStringMessages(), this);
|
||||
UserManagementPanel userManagementPanel = new UserManagementPanel(getUserService(), getStringMessages(), this, tableResources);
|
||||
center.add(new ScrollPanel(userManagementPanel), getStringMessages().users());
|
||||
final SettingsPanel settingsPanel = new SettingsPanel(getUserManagementService(), getStringMessages());
|
||||
center.add(new ScrollPanel(settingsPanel), getStringMessages().settings());
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 583 B |
Reference in New Issue
Block a user