Package com.vlsolutions.swing.docking

Examples of com.vlsolutions.swing.docking.Dockable

@author Lilian Chamontin, vlsolutions. @version 1.0

  public void uninstallUI(JComponent c){
    super.uninstallUI(c);
    uninstallTitleBorder(c);
    titleBar.removePropertyChangeListener(this);
    titleBar.removeAncestorListener(ancestorListener);
    Dockable d = titleBar.getDockable();
    if (d != null){
      d.getDockKey().removePropertyChangeListener(this);
    }
  }
View Full Code Here


  /** Listen to property changes in the DockKey or the title bar  */
  public void propertyChange(PropertyChangeEvent e){
    String pName = e.getPropertyName();
    //System.out.println("property change " + pName);
    if (pName.equals("dockable")){
      Dockable old = (Dockable)e.getOldValue();
      if (old != null){
        old.getDockKey().removePropertyChangeListener(this);
      }
      Dockable newDockable = ((Dockable)e.getNewValue());
      if (newDockable != null){
        configureButtons(titleBar);
        newDockable.getDockKey().addPropertyChangeListener(this);
      }
    } else if (pName.equals(DockKey.PROPERTY_AUTOHIDEABLE)){
      boolean isAutoHideable = ((Boolean)e.getNewValue()).booleanValue();
      boolean isMaximized = titleBar.getDockable()
      .getDockKey().getLocation() == DockableState.Location.MAXIMIZED;
View Full Code Here

        }
       
        boolean isChildOfMaximizedContainer = false;
        DockingDesktop desk = titleBar.getDesktop();
        if (desk != null){
          Dockable max = desk.getMaximizedDockable();
          if (max != null && max.getComponent().getParent().isAncestorOf(titleBar)){
            isChildOfMaximizedContainer = true;
          }
        }
       
       
View Full Code Here

    private class DockingListener implements DockableSelectionListener, DockableStateWillChangeListener,
            DockableStateChangeListener {

        public void selectionChanged(DockableSelectionEvent e) {
            Dockable selectedDockable = e.getSelectedDockable();
            if (selectedDockable instanceof EditorDockable) {
                setCurrentEditorDockable((EditorDockable) selectedDockable);
            }
        }
View Full Code Here

        public void dockableStateWillChange(DockableStateWillChangeEvent event) {
            if (resetWorkspaceOperation)
                return;
            DockableState dockableState = event.getFutureState();
            Dockable dockable = dockableState.getDockable();
            if (dockableState.isClosed() && !canCloseComponent(dockable))
                event.cancel();
            else {
                if (dockable instanceof EditorDockable) {
                    lastClosedEditorDockableContainer = DockingUtilities.findTabbedDockableContainer(dockable);
View Full Code Here

            }
        }

        public void dockableStateChanged(DockableStateChangeEvent event) {
            DockableState dockableState = event.getNewState();
            Dockable dockable = dockableState.getDockable();
            if (dockableState.isClosed() && dockable instanceof EditorDockable) {
                workspace.unregisterDockable(dockable);
                Dockable selectedDockable = null;
                if (lastClosedEditorDockableContainer != null) {
                    selectedDockable = lastClosedEditorDockableContainer.getSelectedDockable();
                    lastClosedEditorDockableContainer = null;
                    if (selectedDockable == null) {
                        selectedDockable = workspace.getSelectedDockable();
View Full Code Here

                    File file = new File(keyName);
                    IEditor e;
                    if (!file.exists())
                        return new FnFDockable(keyName);
                    e = createEditor(file);
                    Dockable dockable = (Dockable) e.getData("dockable");
                    return dockable;
                }
            }
        });
        try {
View Full Code Here

    private int nDirty() {
        int n = 0;
        DockableState[] dockables = workspace.getDockables();
        for (DockableState dockableState : dockables) {
            Dockable dockable = dockableState.getDockable();
            if (dockable instanceof EditorDockable) {
                IEditor editor = ((EditorDockable) dockable).getEditor();
                if (editor.isDirty()) {
                    n++;
                }
View Full Code Here

     * @return
     */
    private boolean saveFileIfNeeded() {
        DockableState[] dockables = workspace.getDockables();
        for (DockableState dockableState : dockables) {
            Dockable dockable = dockableState.getDockable();
            if (dockable instanceof EditorDockable) {
                IEditor editor = ((EditorDockable) dockable).getEditor();
                if (editor.isDirty()) {
                    if (!closeEditor(editor))
                        return false;
View Full Code Here

    private void setCurrentEditorDockable(EditorDockable editorDockable) {
        if (editorDockable == null) {
            editor = null;
        } else if (editor != null) {
            Dockable dockable = (Dockable) editor.getData("dockable");
            TabbedDockableContainer dockableContainer = DockingUtilities.findTabbedDockableContainer(dockable);
            int order = 1;
            if (dockableContainer != null) {
                order = dockableContainer.indexOfDockable(dockable) + 1;
            }
View Full Code Here

TOP

Related Classes of com.vlsolutions.swing.docking.Dockable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.