mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-07 19:42:17 +00:00
Merge branch 'master' of ssh://sapsailing.com/home/trac/git into bug4104
This commit is contained in:
commit
ec60c3d679
74 files changed
+2042
-569
No files matched your search
+2
-2
@@ -24,7 +24,7 @@ import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
* {@link ListEditorComposite} with the respective {@link ExpandedListEditorUi} strategy that will be passed through
|
||||
* from this class's constructor to the {@link #createExpandedUi(List, ExpandedListEditorUi)} method.<p>
|
||||
*
|
||||
* Implementing subclasses may choose to override the {@link #onRowAdded()} and/or the {@link #onRowRemoved()} method(s)
|
||||
* Implementing subclasses may choose to override the {@link #onRowAdded()} and/or the {@link #onRowRemoved(int)} method(s)
|
||||
* to be notified of changes to the list.
|
||||
*
|
||||
* @author Lukas Niemeier
|
||||
@@ -123,7 +123,7 @@ public abstract class CollapsedListEditorUi<ValueType> extends ListEditorUi<Valu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowRemoved() {
|
||||
public void onRowRemoved(int rowIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -24,7 +24,7 @@ import com.sap.sse.gwt.client.StringMessages;
|
||||
* "Remove" button is shown.
|
||||
* <p>
|
||||
*
|
||||
* Implementing subclasses may choose to override the {@link #onRowAdded()} and/or the {@link #onRowRemoved()} method(s)
|
||||
* Implementing subclasses may choose to override the {@link #onRowAdded()} and/or the {@link #onRowRemoved(int)} method(s)
|
||||
* to be notified of changes to the list. Alternatively or in addition, clients can
|
||||
* {@link ListEditorComposite#addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) add a value
|
||||
* change handler} to the enclosing {@link ListEditorComposite}.
|
||||
@@ -37,7 +37,7 @@ import com.sap.sse.gwt.client.StringMessages;
|
||||
public abstract class ExpandedListEditorUi<ValueType> extends ListEditorUi<ValueType> {
|
||||
private final ImageResource removeImage;
|
||||
|
||||
private Grid expandedValuesGrid;
|
||||
protected Grid expandedValuesGrid;
|
||||
private final boolean canRemoveItems;
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public abstract class ExpandedListEditorUi<ValueType> extends ListEditorUi<Value
|
||||
}
|
||||
}
|
||||
|
||||
private void addRow(ValueType newValue) {
|
||||
protected void addRow(ValueType newValue) {
|
||||
int rowIndex = expandedValuesGrid.insertRow(expandedValuesGrid.getRowCount());
|
||||
if (canRemoveItems) {
|
||||
PushButton removeButton = new PushButton(new Image(removeImage));
|
||||
@@ -104,7 +104,7 @@ public abstract class ExpandedListEditorUi<ValueType> extends ListEditorUi<Value
|
||||
context.getValue().remove(rowIndexToRemove);
|
||||
context.onChange();
|
||||
|
||||
onRowRemoved();
|
||||
onRowRemoved(rowIndexToRemove);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,6 +136,6 @@ public abstract class ExpandedListEditorUi<ValueType> extends ListEditorUi<Value
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRowRemoved() {
|
||||
public void onRowRemoved(int rowIndex) {
|
||||
}
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package com.sap.sse.gwt.client.controls.listedit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
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.client.ui.CheckBox;
|
||||
import com.google.gwt.user.client.ui.Grid;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.gwt.client.StringMessages;
|
||||
|
||||
/**
|
||||
* Creates the editable list with a checkbox for every list item
|
||||
*
|
||||
* @author Robin Fleige(D067799)
|
||||
*
|
||||
* @param <ValueType>
|
||||
* The type of the items in the list
|
||||
*/
|
||||
public class ExpandedUiWithCheckboxes<ValueType> extends GenericStringListInlineEditorComposite.ExpandedUi<ValueType> {
|
||||
|
||||
private final List<CheckBox> checkBoxes;
|
||||
private final String checkBoxText;
|
||||
private final List<ChangeHandler> changeHandler = new ArrayList<>();
|
||||
static final ListEditorResources ress = GWT.create(ListEditorResources.class);
|
||||
|
||||
/**
|
||||
* Creates an editable list with checkboxes for every entry
|
||||
*
|
||||
* @param stringMessages
|
||||
* the holder of the used strings
|
||||
* @param removeImage
|
||||
* the icon for removing an entry from the editor
|
||||
* @param suggestValues
|
||||
* values that will be suggested when entering something into the editor
|
||||
* @param placeholderTextForAddTextbox
|
||||
* @param textBoxSize
|
||||
* the size if the textbox
|
||||
* @param checkBoxText
|
||||
* the text shown next to the checkboxes
|
||||
*/
|
||||
public ExpandedUiWithCheckboxes(StringMessages stringMessages, ImageResource removeImage,
|
||||
List<String> suggestValues, String placeholderTextForAddTextbox, int textBoxSize, String checkBoxText) {
|
||||
super(stringMessages, removeImage, suggestValues, placeholderTextForAddTextbox, textBoxSize);
|
||||
this.checkBoxes = new ArrayList<CheckBox>();
|
||||
this.checkBoxText = checkBoxText;
|
||||
ress.css().ensureInjected();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for the css styles
|
||||
*/
|
||||
interface ListEditorResources extends ClientBundle {
|
||||
@Source("ListEditor.gss")
|
||||
ListEditorCSS css();
|
||||
}
|
||||
|
||||
interface ListEditorCSS extends CssResource {
|
||||
String checkBoxInvisible();
|
||||
|
||||
String checkBoxNormal();
|
||||
|
||||
String checkBoxError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the checkboxes,so they can be accessed from another class
|
||||
*
|
||||
* @returns the checkboxes
|
||||
*/
|
||||
public List<CheckBox> getCheckBoxes() {
|
||||
return checkBoxes;
|
||||
}
|
||||
|
||||
/**
|
||||
* used to set the checkbox style from another class
|
||||
*
|
||||
* @returns String the StyleName of the style
|
||||
*/
|
||||
public static String getInvisibleStyle() {
|
||||
return ress.css().checkBoxInvisible();
|
||||
}
|
||||
|
||||
public static String getErrorStyle() {
|
||||
return ress.css().checkBoxError();
|
||||
}
|
||||
|
||||
public static String getNormalStyle() {
|
||||
return ress.css().checkBoxNormal();
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link ExpandedListEditorUi#addRow(Object)}
|
||||
*/
|
||||
@Override
|
||||
protected void addRow(ValueType newValue) {
|
||||
super.addRow(newValue);
|
||||
final CheckBox checkBox = new CheckBox(checkBoxText);
|
||||
checkBox.setStylePrimaryName(getInvisibleStyle());
|
||||
checkBox.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
CheckBox source = (CheckBox) event.getSource();
|
||||
if (source.getValue()) {
|
||||
source.setStylePrimaryName(getNormalStyle());
|
||||
} else {
|
||||
source.setStylePrimaryName(getErrorStyle());
|
||||
}
|
||||
for (ChangeHandler changeHandler : ExpandedUiWithCheckboxes.this.changeHandler) {
|
||||
changeHandler.onChange(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
checkBoxes.add(checkBox);
|
||||
expandedValuesGrid.setWidget(expandedValuesGrid.getRowCount() - 1, 2, checkBox);
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link ListEditorUiStrategy#initWidget()}
|
||||
*/
|
||||
@Override
|
||||
public Widget initWidget() {
|
||||
expandedValuesGrid = new Grid(0, 3);
|
||||
expandedValuesGrid.ensureDebugId("ExpandedValuesGrid");
|
||||
|
||||
VerticalPanel panel = new VerticalPanel();
|
||||
panel.add(createAddWidget());
|
||||
panel.add(expandedValuesGrid);
|
||||
return panel;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link ListEditorUiStrategy#onRowRemoved(int)}
|
||||
*/
|
||||
@Override
|
||||
public void onRowRemoved(int rowIndex) {
|
||||
checkBoxes.remove(rowIndex);
|
||||
}
|
||||
|
||||
public void addChangeHandler(ChangeHandler handler) {
|
||||
changeHandler.add(handler);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
.checkBoxInvisible {
|
||||
visibility : hidden;
|
||||
background-color : red;
|
||||
padding: 3px;
|
||||
padding-right: 5px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.checkBoxNormal {
|
||||
visibility : visible;
|
||||
background-color : white;
|
||||
padding: 3px;
|
||||
padding-right: 5px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.checkBoxError {
|
||||
visibility : visible;
|
||||
background-color : red;
|
||||
padding: 3px;
|
||||
padding-right: 5px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
+3
-2
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
* {@link ListEditorComposite#getValue() values} of the context editor that was passed to
|
||||
* {@link #setContext(ListEditorComposite)} during editor initialization.<p>
|
||||
*
|
||||
* Objects will receive calls to {@link #onRowAdded()} when a value was added to the list, and {@link #onRowRemoved()} when
|
||||
* Objects will receive calls to {@link #onRowAdded()} when a value was added to the list, and {@link #onRowRemoved(int)} when
|
||||
* a value was removed from the list.<p>
|
||||
*
|
||||
* There are two default implementations of this interface: {@link CollapsedListEditorUi} and {@link ExpandedListEditorUi}.
|
||||
@@ -54,6 +54,7 @@ public interface ListEditorUiStrategy<ValueType> {
|
||||
/**
|
||||
* Called by the framework after a value was removed from the list. Note that this is not the place for this UI
|
||||
* strategy to actually implement the UI changes. Those are expected to already have happened before.
|
||||
* @param rowIndex The index of the removed row
|
||||
*/
|
||||
void onRowRemoved();
|
||||
void onRowRemoved(int rowIndex);
|
||||
}
|
||||
+2
@@ -19,6 +19,8 @@ public interface FileStorageManagementGwtService extends RemoteService {
|
||||
FileStorageServiceDTO[] getAvailableFileStorageServices(String localeInfoName);
|
||||
|
||||
/**
|
||||
* If serviceName is null, calls {@link FileStorageManagementGwtService#getActiveFileStorageServiceName()} and uses the returned name
|
||||
*
|
||||
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
|
||||
*/
|
||||
FileStorageServicePropertyErrorsDTO testFileStorageServiceProperties(String serviceName, String localeInfoName) throws NoCorrespondingServiceRegisteredException, IOException;
|
||||
|
||||
@@ -25,6 +25,7 @@ public abstract class AbstractMediaDTO implements IsSerializable, Comparable<Abs
|
||||
protected String locale;
|
||||
|
||||
/** for GWT */
|
||||
@Deprecated
|
||||
protected AbstractMediaDTO() {
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.sap.sse.common.media.MimeType;
|
||||
public class ImageDTO extends AbstractMediaDTO {
|
||||
|
||||
/** for GWT */
|
||||
@Deprecated
|
||||
protected ImageDTO() {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.sap.sse.gwt.client.media;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
import com.sap.sse.common.media.MediaTagConstants;
|
||||
import com.sap.sse.common.media.MimeType;
|
||||
|
||||
/**
|
||||
* Used to transfer an {@link ImageDTO} and a list of {@link MediaTagConstants} which store information on how to resize the image
|
||||
* This class is used to validate an ImageDTO in the ImageDialog.ImageParameterValidator.
|
||||
* After the validation passed, if the resizingTask is empty, it will be only used to transfer the ImageDTO.
|
||||
* If the resizingTask is not empty it will be transfered to the SailingService#resizeImage,
|
||||
* where it will be used to create multiple {@link ImageDTO} with sizes fitting to the {@link MediaTagConstants}
|
||||
*
|
||||
* @author Robin Fleige (D067799)
|
||||
*
|
||||
*/
|
||||
public class ImageResizingTaskDTO implements IsSerializable {
|
||||
|
||||
private ImageDTO image;
|
||||
// contains the list of resizing tasks, can not be null, if this is empty the ImageResizingTaskDTO is only an upload
|
||||
// task
|
||||
private List<MediaTagConstants> resizingTask;
|
||||
|
||||
/** for GWT */
|
||||
@Deprecated
|
||||
protected ImageResizingTaskDTO() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an {@link ImageDTO} from the parameters
|
||||
*
|
||||
* @param imageRef
|
||||
* needed for creating ImageDTO
|
||||
* @param createdAtDate
|
||||
* needed for creating ImageDTO
|
||||
* @param resizingTask
|
||||
* stored Information about resizing
|
||||
*/
|
||||
public ImageResizingTaskDTO(String imageRef, Date createdAtDate, List<MediaTagConstants> resizingTask) {
|
||||
this(new ImageDTO(imageRef, createdAtDate), resizingTask);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param image
|
||||
* the stored ImageDTO
|
||||
* @param resizingTask
|
||||
* stored Information about resizing
|
||||
*/
|
||||
public ImageResizingTaskDTO(ImageDTO image, List<MediaTagConstants> resizingTask) {
|
||||
this.image = image;
|
||||
this.resizingTask = resizingTask;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns the ImageDTO
|
||||
*/
|
||||
public ImageDTO getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns the List of MediaTagConstants
|
||||
*/
|
||||
public List<MediaTagConstants> getResizingTask() {
|
||||
return resizingTask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clone of the ImageDTo with new references, so they do not interfere Used for resizing to edit
|
||||
* afterwards, to easily copy all data from the original ImageDTO
|
||||
*
|
||||
* @returns a clone of the ImageDTO
|
||||
*/
|
||||
public ImageDTO cloneImageDTO() {
|
||||
final ImageDTO toReturn = new ImageDTO(image.getSourceRef(), image.getCreatedAtDate());
|
||||
toReturn.setTitle(image.getTitle());
|
||||
toReturn.setCopyright(image.getCopyright());
|
||||
toReturn.setLocale(image.getLocale());
|
||||
// creating a new mimetype object so they do not use the same reference
|
||||
toReturn.setMimeType(MimeType.byName(image.getMimeType().name()));
|
||||
toReturn.setSizeInPx(image.getWidthInPx(), image.getHeightInPx());
|
||||
toReturn.setSubtitle(image.getSubtitle());
|
||||
// Creating a new list, so they have the same tags, but not use the same reference to these tags, otherwise they
|
||||
// could affect each other by editing this list
|
||||
final List<String> tags = new ArrayList<>();
|
||||
tags.addAll(image.getTags());
|
||||
toReturn.setTags(tags);
|
||||
return toReturn;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ public class VideoDTO extends AbstractMediaDTO {
|
||||
private String thumbnailRef;
|
||||
|
||||
/** for GWT */
|
||||
@Deprecated
|
||||
protected VideoDTO() {
|
||||
}
|
||||
|
||||
@@ -34,7 +35,7 @@ public class VideoDTO extends AbstractMediaDTO {
|
||||
}
|
||||
|
||||
public boolean isFeatured() {
|
||||
return hasTag(MediaTagConstants.FEATURED);
|
||||
return hasTag(MediaTagConstants.FEATURED.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -729,7 +729,7 @@ body ::-webkit-scrollbar-track {
|
||||
}
|
||||
|
||||
.gwt-Button, .gwt-Button:visited {
|
||||
font-size: 0, 9rem;
|
||||
font-size: 0.9rem;
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
border: none;
|
||||
|
||||
Reference in new issue
Block a user