no message
This commit is contained in:
@@ -15,6 +15,7 @@ public class SapforVersion_json implements Serializable {
|
||||
public String version = "";
|
||||
@Expose
|
||||
public String description = "";
|
||||
public boolean success = true;
|
||||
//поля для отображения деревьев.
|
||||
public File Home = null;
|
||||
public Vector<ProjectFile> files = null;
|
||||
|
||||
@@ -57,8 +57,10 @@ public class SapforTask extends DBObject {
|
||||
DefaultMutableTreeNode child = null;
|
||||
DefaultMutableTreeNode parent = null;
|
||||
//--
|
||||
|
||||
for (SapforVersion_json version_json : versions) {
|
||||
version_json.init(configurationRoot);
|
||||
//-
|
||||
child = new DefaultMutableTreeNode(version_json);
|
||||
if (parent == null) {
|
||||
root = child;
|
||||
@@ -67,8 +69,10 @@ public class SapforTask extends DBObject {
|
||||
parent.add(child);
|
||||
parent = child;
|
||||
}
|
||||
//-
|
||||
}
|
||||
if (parent != null) {
|
||||
|
||||
for (SapforVersion_json version_json : variants) {
|
||||
version_json.init(configurationRoot);
|
||||
parent.add(new DefaultMutableTreeNode(version_json));
|
||||
|
||||
@@ -19,6 +19,12 @@ public class SapforTasksPackageTree extends DataTree {
|
||||
@Override
|
||||
public void LeftMouseAction2() {
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
public TreeRenderers getRenderer() {
|
||||
return TreeRenderers.RendererSapforVersion;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public Current getCurrent() {
|
||||
return current;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package SapforTestingSystem.SapforTasksPackage.UI;
|
||||
import Common.UI.Trees.StyledTreeCellRenderer;
|
||||
import SapforTestingSystem.Json.SapforVersion_json;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.net.URL;
|
||||
public class SapforVersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
public java.awt.Component getTreeCellRendererComponent(
|
||||
JTree tree, Object value,
|
||||
boolean selected, boolean expanded,
|
||||
boolean leaf, int row, boolean hasFocus) {
|
||||
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
|
||||
URL imageUrl = null;
|
||||
Object o = ((DefaultMutableTreeNode) value).getUserObject();
|
||||
if (o instanceof SapforVersion_json) {
|
||||
SapforVersion_json version_json = (SapforVersion_json) o;
|
||||
setForeground(tree.getForeground());
|
||||
setFont(getFont().deriveFont((float) 14.0));
|
||||
imageUrl = getClass().getResource("/icons/versions/" +
|
||||
(version_json.success ? "Version" : "BadVersion") +
|
||||
".png");
|
||||
if (imageUrl != null) {
|
||||
setIcon(new ImageIcon(imageUrl));
|
||||
}
|
||||
} else {
|
||||
setForeground(tree.getForeground());
|
||||
setFont(getFont().deriveFont((float) 14.0));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user