use of com.vlsolutions.swing.docking.DockingDesktop in project omegat by omegat-org.
the class EditorController method createUI.
private void createUI() {
pane = new DockablePanel("EDITOR", " ", false);
pane.setComponentOrientation(ComponentOrientation.getOrientation(Locale.getDefault()));
pane.setMinimumSize(new Dimension(100, 100));
pane.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
updateTitle();
}
});
scrollPane = new JScrollPane(editor);
Border panelBorder = UIManager.getBorder("OmegaTDockablePanel.border");
if (panelBorder != null) {
scrollPane.setBorder(panelBorder);
}
Border viewportBorder = UIManager.getBorder("OmegaTDockablePanelViewport.border");
if (viewportBorder != null) {
scrollPane.setViewportBorder(viewportBorder);
}
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scrollPane.getVerticalScrollBar().addAdjustmentListener(scrollListener);
pane.setLayout(new BorderLayout());
pane.add(scrollPane, BorderLayout.CENTER);
mw.addDockable(pane);
DockingDesktop desktop = UIDesignManager.getDesktop(pane);
if (desktop != null) {
desktop.addDockableSelectionListener(e -> dockableSelected = pane == e.getSelectedDockable());
}
}
use of com.vlsolutions.swing.docking.DockingDesktop in project omegat by omegat-org.
the class MainWindowUI method initDocking.
/**
* Create docking desktop panel.
*/
public static DockingDesktop initDocking(final MainWindow mainWindow) {
mainWindow.desktop = new DockingDesktop();
mainWindow.desktop.addDockableStateWillChangeListener(new DockableStateWillChangeListener() {
public void dockableStateWillChange(DockableStateWillChangeEvent event) {
if (event.getFutureState().isClosed()) {
event.cancel();
}
}
});
return mainWindow.desktop;
}
Aggregations