diff options
author | Jonathan Bauer | 2019-04-04 15:38:10 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-04-04 15:38:10 +0200 |
commit | 4f08beb1570b762397003c85ee71b7373a891666 (patch) | |
tree | d0c7df462ddc2a9b93f3f1771c3e65b810a62afc /dozentenmodul | |
parent | [client] Scripte -> Skripte (diff) | |
download | tutor-module-4f08beb1570b762397003c85ee71b7373a891666.tar.gz tutor-module-4f08beb1570b762397003c85ee71b7373a891666.tar.xz tutor-module-4f08beb1570b762397003c85ee71b7373a891666.zip |
[client] show predefined shares in a light gray
Diffstat (limited to 'dozentenmodul')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java index 30994eae..e0c185d4 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/table/NetshareTable.java @@ -1,8 +1,14 @@ package org.openslx.dozmod.gui.control.table; +import java.awt.Color; +import java.awt.Component; + +import javax.swing.UIManager; + import org.openslx.bwlp.thrift.iface.NetShare; import org.openslx.bwlp.thrift.iface.NetShareAuth; import org.openslx.dozmod.gui.configurator.NetshareConfigurator; +import org.openslx.dozmod.gui.helper.ColorUtil; import org.openslx.dozmod.thrift.Sorters; import org.openslx.dozmod.util.FormatHelper; @@ -17,8 +23,13 @@ public class NetshareTable extends CheckListTable<NetShare> { public static final ListTableColumn COL_USER = new ListTableColumn("Username"); public static final ListTableColumn COL_PASSWORD = new ListTableColumn("Passwort"); + private final Color invalidColor; + public NetshareTable() { super(COL_NAME, COL_PATH, COL_MOUNT, COL_AUTH, COL_USER, COL_PASSWORD); + Color fg = UIManager.getColor("Table.foreground"); + Color bg = UIManager.getColor("Table.background"); + invalidColor = ColorUtil.blend(fg, bg, .66f); } @Override @@ -66,6 +77,17 @@ public class NetshareTable extends CheckListTable<NetShare> { } @Override + public Component prepareRenderHook2(Component component, NetShare row, + ListTableColumn listTableColumn, boolean isSelected) { + if (row.shareId == 0) { + component.setForeground(isSelected ? getSelectionForeground() : getForeground()); + } else { + component.setForeground(invalidColor); + } + return component; + } + + @Override protected boolean isItemCheckable(NetShare item) { return item.shareId > 0; } |