use of org.omegat.gui.main.DockablePanel 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());
}
}
Aggregations