Search in sources :

Example 6 with UniqueView

use of com.ramussoft.gui.common.UniqueView in project ramus by Vitaliy-Yakovchuk.

the class Control method setActive.

public void setActive(DFrame dockable) {
    if (dockable instanceof TabFrame) {
        openTab(dockable, area);
    } else {
        UniqueDFrame frame = (UniqueDFrame) dockable;
        UniqueView view = (UniqueView) frame.getView();
        if (!view.getDefaultWorkspace().equals(layout))
            factory.setCurrentWorkspace(getDefaultWorkspaces(view.getDefaultWorkspace()).get(0));
        UniqueViewsHolder holder = getHolder(layout);
        if (holder.left instanceof JTabbedPane)
            openTab(dockable, (JTabbedPane) holder.left);
        if (holder.top instanceof JTabbedPane)
            openTab(dockable, (JTabbedPane) holder.top);
        if (holder.right instanceof JTabbedPane)
            openTab(dockable, (JTabbedPane) holder.right);
        if (holder.bottom instanceof JTabbedPane)
            openTab(dockable, (JTabbedPane) holder.bottom);
    }
    dockable.requestFocus();
}
Also used : UniqueView(com.ramussoft.gui.common.UniqueView) JTabbedPane(javax.swing.JTabbedPane)

Example 7 with UniqueView

use of com.ramussoft.gui.common.UniqueView in project ramus by Vitaliy-Yakovchuk.

the class SimleGUIPluginFactory method openView.

protected boolean openView(ActionEvent actionEvent) {
    for (UniqueView view : uniqueViews) {
        if (actionEvent.equals(view.getOpenAction())) {
            UniqueDFrame dockable = findUniqueDockable(view.getId());
            control.setActive(dockable);
            return true;
        }
    }
    Enumeration<TabView> enumeration = tabDockables.keys();
    while (enumeration.hasMoreElements()) {
        TabView view = enumeration.nextElement();
        if (actionEvent.equals(view.getOpenAction())) {
            TabFrame dockable = tabDockables.get(view);
            control.setActive(dockable);
            return true;
        }
    }
    return false;
}
Also used : UniqueView(com.ramussoft.gui.common.UniqueView) TabView(com.ramussoft.gui.common.TabView)

Example 8 with UniqueView

use of com.ramussoft.gui.common.UniqueView in project ramus by Vitaliy-Yakovchuk.

the class AbstractTableView method init.

private void init(HTMLPrintable printable) {
    try {
        String title;
        if (this instanceof UniqueView) {
            title = getString(((UniqueView) this).getId());
        } else if (this instanceof TabView) {
            title = ((TabView) this).getTitle();
        } else {
            title = getQualifier().getName();
        }
        OutputStream os = printable.getOutputStream();
        String top = "<html>\n<head>\n<title>" + title + "</title>\n</head>\n\n<body>\n";
        os.write(top.getBytes());
        os.write(table.getBodyText(title).getBytes());
        os.write("</body>\n</html>\n".getBytes());
        os.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : UniqueView(com.ramussoft.gui.common.UniqueView) TabView(com.ramussoft.gui.common.TabView) OutputStream(java.io.OutputStream) PrinterException(java.awt.print.PrinterException)

Aggregations

UniqueView (com.ramussoft.gui.common.UniqueView)8 TabView (com.ramussoft.gui.common.TabView)5 DefaultSingleCDockable (bibliothek.gui.dock.common.DefaultSingleCDockable)2 TabbedView (com.ramussoft.gui.common.TabbedView)2 View (com.ramussoft.gui.common.View)2 ActionEvent (com.ramussoft.gui.common.event.ActionEvent)2 ActionListener (com.ramussoft.gui.common.event.ActionListener)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Entry (java.util.Map.Entry)2 CControl (bibliothek.gui.dock.common.CControl)1 CWorkingArea (bibliothek.gui.dock.common.CWorkingArea)1 SingleCDockable (bibliothek.gui.dock.common.SingleCDockable)1 CControlListener (bibliothek.gui.dock.common.event.CControlListener)1 CFocusListener (bibliothek.gui.dock.common.event.CFocusListener)1 CDockable (bibliothek.gui.dock.common.intern.CDockable)1 DefaultCDockable (bibliothek.gui.dock.common.intern.DefaultCDockable)1 ActionDescriptor (com.ramussoft.gui.common.ActionDescriptor)1 ActionEvent (java.awt.event.ActionEvent)1 PrinterException (java.awt.print.PrinterException)1