Java Code Examples for bibliothek.gui.dock.common.DefaultSingleCDockable#setCloseable()

The following examples show how to use bibliothek.gui.dock.common.DefaultSingleCDockable#setCloseable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DockingManager.java    From openAGV with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new dockable.
 *
 * @param id The unique id for this dockable.
 * @param title The title text of this new dockable.
 * @param comp The JComponent wrapped by the new dockable.
 * @param closeable If the dockable can be closeable or not.
 * @return The newly created dockable.
 */
public DefaultSingleCDockable createDockable(String id,
                                             String title,
                                             JComponent comp,
                                             boolean closeable) {
  Objects.requireNonNull(id, "id is null");
  Objects.requireNonNull(title, "title is null");
  Objects.requireNonNull(comp, "comp is null");
  if (control == null) {
    return null;
  }
  DefaultSingleCDockable dockable = new DefaultSingleCDockable(id, title);
  dockable.setCloseable(closeable);
  dockable.add(comp);
  return dockable;
}
 
Example 2
Source File: DockingFrame.java    From Rails with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Registers a component that is to become a dockable.
 * The dockable is only deployed to the frame if deployDockables is called.
 */
protected void addDockable(JComponent c,
        String dockableConfigKey,
        int x, int y, int width, int height,
        DockableProperty dockableProperty) {
    String dockableTitle = LocalText.getText(dockableConfigKey);
    DefaultSingleCDockable d = new DefaultSingleCDockable(
            dockableTitle, dockableTitle );
    d.add( c, BorderLayout.CENTER );
    d.setTitleIcon(RailsIcon.getByConfigKey(dockableConfigKey).smallIcon);
    d.setCloseable(
            (  dockableProperty == DockableProperty.CLOSEABLE
            || dockableProperty == DockableProperty.INITIALLY_HIDDEN)
    );
    gridLayout.add( x, y, width, height, d );
    dockables.add(d);
    if (dockableProperty == DockableProperty.INITIALLY_HIDDEN ) {
        dockables_initiallyHidden.add(d);
    }
}
 
Example 3
Source File: GuiUtil.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Create dockable
 * @param title
 * @param color
 * @return 
 */
public static SingleCDockable createDockable(String title, Color color) {
    JPanel panel = new JPanel();
    panel.setOpaque(true);
    panel.setBackground(color);
    DefaultSingleCDockable dockable = new DefaultSingleCDockable(title, title, panel);
    dockable.setCloseable(true);
    return dockable;
}
 
Example 4
Source File: GuiUtil.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Create editor dockable
 * @param title Title
 * @return Editor dockable
 */
public static SingleCDockable createEditorDockable(String title) {
    JTabbedPane tabbedPanel = new JTabbedPane(); 
    addNewTextEditor("New", tabbedPanel);
    DefaultSingleCDockable dockable = new DefaultSingleCDockable(title, title, tabbedPanel);
    dockable.setCloseable(true);
    return dockable;
}