Skip to content

Commit

Permalink
fixed Shiva skin
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed Jan 3, 2025
1 parent 47510e6 commit 8bd7d65
Show file tree
Hide file tree
Showing 14 changed files with 12,928 additions and 362 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<GUIAttribute> getAttributes() {
}

public List<String> getAttributeNames() {
return attributes.stream().map(att -> att.getName()).collect(Collectors.toList());
return attributes.stream().map(att -> att.getName()).collect(Collectors.toUnmodifiableList());
}

public void setAttributes(List<GUIAttribute> attributes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void setId(long id) {
}

public List<Long> getTemplateIds() {
return templates.stream().map(t -> t.getId()).collect(Collectors.toList());
return templates.stream().map(t -> t.getId()).collect(Collectors.toUnmodifiableList());
}

public Long getAosManagerId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public List<GUIReadingRequest> getUnconfirmedReadings(long docId) {
public List<Long> getUnconfirmedReadingIds(long docId) {
List<Long> readingIds = new ArrayList<>();
if (isReadingConfirmRequired(docId)) {
readingIds = unconfirmedReadings.get(docId).stream().map(r -> r.getId()).collect(Collectors.toList());
readingIds = unconfirmedReadings.get(docId).stream().map(r -> r.getId()).collect(Collectors.toUnmodifiableList());
}
return readingIds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,29 @@ public void info(String message, String detail) {
public void cleanLabel() {
statusLabel.setContents("");
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((statusLabel == null) ? 0 : statusLabel.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
EventPanel other = (EventPanel) obj;
if (statusLabel == null) {
if (other.statusLabel != null)
return false;
} else if (!statusLabel.equals(other.statusLabel))
return false;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,29 @@ public void addEvent(GUIEvent event) {
public static MessagesWindow get() {
return instance;
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((grid == null) ? 0 : grid.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
MessagesWindow other = (MessagesWindow) obj;
if (grid == null) {
if (other.grid != null)
return false;
} else if (!grid.equals(other.grid))
return false;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ public static TextAreaItem newTextAreaItemForAutomation(String name, String valu
private static void appendAutomationEditorIcon(FormItem item, ChangedHandler handler, boolean withHtmlEditor) {
FormItemIcon editAutomation = new FormItemIcon();
editAutomation.setName("editautomation");
editAutomation.setSrc("[SKIN]/java.png");
editAutomation.setSrc("[SKIN]/java.svg");
editAutomation.setPrompt(I18N.message("openautomationeditor"));
editAutomation.addFormItemClickHandler(click -> new AutomationItemEditor(item, handler).show());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,26 @@ public void onSuccess(Void result) {
});
}
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (int) (userId ^ (userId >>> 32));
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
Avatar other = (Avatar) obj;
if (userId != other.userId)
return false;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,29 @@ private void generateHourly() {
vm.getItem(EXPRESSION).setValue("0 " + m + " " + h + DEFAULT_CRON_END_EXPRESSION);
}
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((sourceItem == null) ? 0 : sourceItem.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
CronExpressionComposer other = (CronExpressionComposer) obj;
if (sourceItem == null) {
if (other.sourceItem != null)
return false;
} else if (!sourceItem.equals(other.sourceItem))
return false;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public IncrementalSettingsPanel(GUIIncrementalArchive incremental, ChangedHandle
templates = ItemFactory.newTemplateSelector(false, null);
templates.addChangedHandler(changedHandler);
templates.setValues(incremental.getTemplateIds().stream().map(id -> Long.toString(id))
.collect(Collectors.toList()).toArray(new String[0]));
.collect(Collectors.toUnmodifiableList()).toArray(new String[0]));

form.setFields(prefix, frequency, folderSelector, templates);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.logicaldoc.gui.common.client.Feature;
Expand Down Expand Up @@ -306,43 +305,38 @@ public void onDraw() {
* @return an array of select items
*/
public SelectItem[] getEventTypes() {
List<SelectItem> items = new ArrayList<>();
return items.toArray(new SelectItem[0]);
return new ArrayList<>().toArray(new SelectItem[0]);
}

@SuppressWarnings("unchecked")
private void onSearch() {
histories.setData();

final Map<String, Object> values = vm.getValues();

if (Boolean.FALSE.equals(vm.validate()))
return;

List<String> eventValues = getEvents(values);
List<String> eventValues = getEvents();

Long userId = getUserId(values);
Long userId = getUserId();

Date fromValue = null;
if (values.get(FROM_DATE) != null)
fromValue = (Date) values.get(FROM_DATE);
if (vm.getValue(FROM_DATE) != null)
fromValue = (Date) vm.getValue(FROM_DATE);
Date tillValue = null;
if (values.get(TILL_DATE) != null)
tillValue = (Date) values.get(TILL_DATE);
if (vm.getValue(TILL_DATE) != null)
tillValue = (Date) vm.getValue(TILL_DATE);

String sid = null;
if (values.get("sid") != null)
sid = (String) values.get("sid");
if (vm.getValue("sid") != null)
sid = vm.getValueAsString("sid");

int displayMaxValue = getDisplayMax(values);
int displayMaxValue = getDisplayMax();

doSearch(eventValues, userId, fromValue, tillValue, sid, displayMaxValue);
}

private List<String> getEvents(final Map<String, Object> values) {
private List<String> getEvents() {
String[] eventValues = new String[0];
if (values.get(EVENT) != null) {
String buf = values.get(EVENT).toString().trim().toLowerCase();
if (vm.getValue(EVENT) != null) {
String buf = vm.getValueAsString(EVENT).trim().toLowerCase();
buf = buf.replace('[', ' ');
buf = buf.replace(']', ' ');
buf = buf.replace(" ", "");
Expand All @@ -351,24 +345,24 @@ private List<String> getEvents(final Map<String, Object> values) {
return Arrays.asList(eventValues);
}

private Long getUserId(final Map<String, Object> values) {
private Long getUserId() {
Long userId = null;
if (values.get("user") != null) {
if (values.get("user") instanceof Long longVal)
if (vm.getValue("user") != null) {
if (vm.getValue("user") instanceof Long longVal)
userId = longVal;
else
userId = Long.parseLong(values.get("user").toString());
userId = Long.parseLong(vm.getValueAsString("user"));
}
return userId;
}

private int getDisplayMax(final Map<String, Object> values) {
private int getDisplayMax() {
int displayMaxValue = 0;
if (values.get(DISPLAYMAX) != null) {
if (values.get(DISPLAYMAX) instanceof Integer intVal)
if (vm.getValue(DISPLAYMAX) != null) {
if (vm.getValue(DISPLAYMAX) instanceof Integer intVal)
displayMaxValue = intVal;
else
displayMaxValue = Integer.parseInt((String) values.get(DISPLAYMAX));
displayMaxValue = Integer.parseInt(vm.getValueAsString(DISPLAYMAX));
}
return displayMaxValue;
}
Expand Down
2 changes: 2 additions & 0 deletions logicaldoc-gui/war/footer.jsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>


<link REL="STYLESHEET" HREF="<%=MODULE%>/sc/skins/<%=SKIN%>/style.css" TYPE="text/css" />
</html>
3 changes: 0 additions & 3 deletions logicaldoc-gui/war/frontend.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@

<%@ include file="body.jsp" %>

<!-- Make sure custom stype is last loaded -->
<link REL="STYLESHEET" HREF="<%=MODULE%>/sc/skins/<%=SKIN%>/style.css" TYPE="text/css" />

<%@ include file="footer.jsp" %>
1 change: 0 additions & 1 deletion logicaldoc-gui/war/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ body {

<link href="./fontawesome/css/all.min.css" rel="stylesheet">

<link REL="STYLESHEET" HREF="<%=MODULE%>/sc/skins/<%=SKIN%>/style.css" TYPE="text/css" />
<link id="favicon" rel="shortcut icon" type="image/png" href='' />
<script type="text/javascript">
// Determine what skin file to load
Expand Down
Loading

0 comments on commit 8bd7d65

Please sign in to comment.