Skip to content

Commit

Permalink
ColumnControlIcon in ColumnControlButton austauschen
Browse files Browse the repository at this point in the history
  • Loading branch information
homebeaver committed Nov 8, 2019
1 parent b22ecd4 commit 1bec5bd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions client/src/test/java/com/klst/client/MenuPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
import java.util.Properties;
import java.util.logging.Logger;

import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JRootPane;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;

import org.compiere.model.MMenu;
import org.compiere.model.MTree_NodeMM;
import org.compiere.util.Env;
import org.jdesktop.swingx.JXButton;
import org.jdesktop.swingx.JXPanel;
Expand All @@ -41,6 +40,7 @@
import org.jdesktop.swingx.renderer.StringValue;
import org.jdesktop.swingx.renderer.StringValues;
import org.jdesktop.swingx.renderer.WrappingIconPanel;
import org.jdesktop.swingx.table.ColumnControlButton;
import org.jdesktop.swingx.treetable.TreeTableModel;

import com.jhlabs.image.InvertFilter;
Expand Down Expand Up @@ -217,6 +217,20 @@ public String getString(Object value) {
// </snip>
// tree.setRowHeight(-1);

tree.setColumnControl(new ColumnControlButton(tree) { // das Icon austauschen
@Override
protected void updateActionUI() {
if (getAction() == null) return;
AbstractImageTranscoder AIT = AbstractImageTranscoder.getInstance();
Icon icon = AIT.getImageIcon(AIT.MENU, SMALL_ICON_SIZE);
// if ((icon == null) || (icon instanceof UIResource)) {
// icon = UIManager.getIcon(COLUMN_CONTROL_BUTTON_ICON_KEY);
// getAction().putValue(Action.SMALL_ICON, icon);
// }
getAction().putValue(Action.SMALL_ICON, icon);
}

});
tree.setColumnControlVisible(true); // ColumnControl == der kleine Controler ColumnControlButton rechts bei den Tabellenüberschriften
// org.jdesktop.swingx.icon.ColumnControlIcon implementiert das Icon

Expand Down

0 comments on commit 1bec5bd

Please sign in to comment.