/** Initializes the tree & model. */ private void initializeList() { // initilizes the JTree model = createModel(); list = createList(); list.setModel(model); setViewportView(list); { AbstractAction action = new GoUpAction(); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0); list.registerKeyboardAction(action, key, JComponent.WHEN_FOCUSED); } { AbstractAction action = new EnterAction(); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0); list.registerKeyboardAction(action, key, JComponent.WHEN_FOCUSED); } managerListener = new Listener(); popupSupport = new PopupSupport(); list.getActionMap().put("org.openide.actions.PopupAction", popupSupport); // NOI18N list.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); ToolTipManager.sharedInstance().registerComponent(list); }
/** Initializes the tree & model. */ private void initializeList () { // initilizes the JTree model = createModel (); list = createList (); list.setModel (model); setViewportView (list); { AbstractAction action = new GoUpAction (); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0); list.registerKeyboardAction(action, key, JComponent.WHEN_FOCUSED); } { AbstractAction action = new EnterAction (); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0); list.registerKeyboardAction(action, key, JComponent.WHEN_FOCUSED); } managerListener = new Listener (); popupSupport = new PopupSupport(); list.getSelectionModel().setSelectionMode( ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); ToolTipManager.sharedInstance ().registerComponent (list); }
/** Initializes the tree & model. */ private void initializeList () { // initilizes the JTree model = createModel (); list = createList (); list.setModel (model); setViewportView (list); { AbstractAction action = new GoUpAction (); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0); list.registerKeyboardAction(action, key, JComponent.WHEN_FOCUSED); } { AbstractAction action = new EnterAction (); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0); list.registerKeyboardAction(action, key, JComponent.WHEN_FOCUSED); } managerListener = new Listener (); popupSupport = new PopupSupport(); list.getSelectionModel().setSelectionMode( ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); ToolTipManager.sharedInstance ().registerComponent (list); }