|
|
|
@ -15,6 +15,7 @@ import com.google.gwt.core.client.GWT;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
|
|
import com.google.gwt.user.client.Window;
|
|
|
|
|
import com.google.gwt.user.client.ui.Button;
|
|
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
|
import com.google.gwt.user.client.ui.HasAlignment;
|
|
|
|
@ -31,6 +32,7 @@ public class SequenceWidget extends Composite {
|
|
|
|
|
|
|
|
|
|
private VerticalPanel myPanel;
|
|
|
|
|
|
|
|
|
|
private Button clearEntryB = new Button("Remove Content");
|
|
|
|
|
private Button addAnotherB = new Button("Add another Entry");
|
|
|
|
|
private Button removeThisB = new Button("Remove Entry");
|
|
|
|
|
private Button selectNewB = new Button("Add Source");
|
|
|
|
@ -147,7 +149,7 @@ public class SequenceWidget extends Composite {
|
|
|
|
|
Metadata toAdd = new Metadata(metadata.getAttribute(), metadata.getValue());
|
|
|
|
|
toReturn.add(toAdd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean keepLooking = true;
|
|
|
|
|
for (Metadata prop : toReturn) {
|
|
|
|
|
if (prop.getAttribute().equals(RSG_BINDING_PROPERTY) && (prop.getValue().contains("[") && prop.getValue().contains("]")) ) {
|
|
|
|
@ -264,6 +266,63 @@ public class SequenceWidget extends Composite {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void showResetFields(boolean show) {
|
|
|
|
|
clearEntryB.setVisible(show);
|
|
|
|
|
|
|
|
|
|
if (buttonsWrapperPanel.getWidgetIndex(clearEntryB) == -1) {
|
|
|
|
|
buttonsWrapperPanel.insert(clearEntryB, 0);
|
|
|
|
|
clearEntryB.getElement().getStyle().setWidth(130, Unit.PX);
|
|
|
|
|
clearEntryB.getElement().getStyle().setMargin(10, Unit.PX);
|
|
|
|
|
clearEntryB.addStyleName("deleteAssociationButton");
|
|
|
|
|
|
|
|
|
|
clearEntryB.addClickHandler(new ClickHandler() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
clearContent();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void clearContent() {
|
|
|
|
|
int widgetsCount = myPanel.getWidgetCount();
|
|
|
|
|
for (int i = 0; i < widgetsCount; i++) {
|
|
|
|
|
if (myPanel.getWidget(i) instanceof ClientReportReference) {
|
|
|
|
|
ClientReportReference toClear = (ClientReportReference) myPanel.getWidget(i);
|
|
|
|
|
toClear.clear();
|
|
|
|
|
toClear.cleanInModel();
|
|
|
|
|
}
|
|
|
|
|
else if (myPanel.getWidget(i) instanceof D4sRichTextarea) {
|
|
|
|
|
D4sRichTextarea toClear = (D4sRichTextarea) myPanel.getWidget(i);
|
|
|
|
|
toClear.setHTML("");
|
|
|
|
|
}
|
|
|
|
|
else if (myPanel.getWidget(i) instanceof BasicTextArea) {
|
|
|
|
|
BasicTextArea toClear = (BasicTextArea) myPanel.getWidget(i);
|
|
|
|
|
toClear.setText("");
|
|
|
|
|
}
|
|
|
|
|
else if (myPanel.getWidget(i) instanceof ClientImage) {
|
|
|
|
|
ClientImage toClear = (ClientImage) myPanel.getWidget(i);
|
|
|
|
|
toClear.resetImage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//clean the fields in the model
|
|
|
|
|
int size = repSequence.getGroupedComponents().size();
|
|
|
|
|
//GWT.log("SequenceWidget Size = " + size);
|
|
|
|
|
for (int j = 0; j < size; j++) {
|
|
|
|
|
BasicComponent sComp = repSequence.getGroupedComponents().get(j);
|
|
|
|
|
//if is not locked and is of type BODY then put fields to blank
|
|
|
|
|
if ((!sComp.isLocked()) && (sComp.getType() == ComponentType.BODY || sComp.getType() == ComponentType.BODY_NOT_FORMATTED ||
|
|
|
|
|
sComp.getType() == ComponentType.DYNA_IMAGE) ) {
|
|
|
|
|
sComp.setPossibleContent("");
|
|
|
|
|
sComp.setMetadata(setPropertiesForRSG(sComp.getMetadata()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ArrayList<TemplateComponent> getSeqGroupedComponents() {
|
|
|
|
|
return seqGroupedComponents;
|
|
|
|
|
}
|
|
|
|
|