home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.basic;
-
- import com.sun.java.swing.BorderFactory;
- import com.sun.java.swing.Icon;
- import com.sun.java.swing.JComponent;
- import com.sun.java.swing.JList;
- import com.sun.java.swing.JScrollPane;
- import com.sun.java.swing.plaf.ComponentUI;
- import com.sun.java.swing.plaf.DirectoryPaneUI;
- import com.sun.java.swing.preview.JDirectoryPane;
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.IllegalComponentStateException;
-
- public class BasicDirectoryPaneUI extends DirectoryPaneUI {
- protected JDirectoryPane directoryPane;
- protected JList list;
- protected JScrollPane scroller;
- static Icon directoryIcon = null;
- static Icon fileIcon = null;
- static Icon computerIcon = null;
- static Icon hardDriveIcon = null;
- static Icon floppyDriveIcon = null;
-
- public static ComponentUI createUI(JComponent var0) {
- return new BasicDirectoryPaneUI((JDirectoryPane)var0);
- }
-
- public BasicDirectoryPaneUI(JDirectoryPane var1) {
- }
-
- public void installUI(JComponent var1) {
- this.directoryPane = (JDirectoryPane)var1;
- this.directoryPane.setLayout(new BorderLayout());
- this.list = new JList();
- this.list.setCellRenderer(new LabelCellRenderer());
- this.list.setBackground(Color.white);
- this.list.setModel(this.directoryPane.getModel());
- this.list.addMouseListener(new 1(this));
- this.scroller = new JScrollPane(this.list);
- this.scroller.setBorder(BorderFactory.createLoweredBevelBorder());
- this.directoryPane.add(this.scroller, "Center");
- this.list.setSelectionModel(this.directoryPane.getListSelectionModel());
- }
-
- public void uninstallUI(JComponent var1) {
- if (var1 != this.directoryPane) {
- throw new IllegalComponentStateException(this + " was asked to deinstall() " + var1 + " when it only knows about " + this.directoryPane + ".");
- } else {
- this.directoryPane.remove(this.scroller);
- }
- }
- }
-