use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class StudyNewProjectPanel method layoutPanel.
private void layoutPanel() {
myCoursesComboBox = new ComboBox<>();
final LabeledComponent<ComboBox> coursesCombo = LabeledComponent.create(myCoursesComboBox, "Courses:", BorderLayout.WEST);
myRefreshButton = new FixedSizeButton(coursesCombo);
if (SystemInfo.isMac && !UIUtil.isUnderDarcula())
myRefreshButton.putClientProperty("JButton.buttonType", null);
myRefreshButton.setIcon(AllIcons.Actions.Refresh);
myBrowseButton = new FixedSizeButton(coursesCombo);
final JPanel comboPanel = new JPanel(new BorderLayout());
comboPanel.add(coursesCombo, BorderLayout.CENTER);
comboPanel.add(myRefreshButton, BorderLayout.EAST);
final JPanel coursesPanel = new JPanel(new BorderLayout());
coursesPanel.add(comboPanel, BorderLayout.CENTER);
coursesPanel.add(myBrowseButton, BorderLayout.EAST);
add(coursesPanel);
myAnchor = coursesCombo;
final JPanel panel = new JPanel(new BorderLayout());
final JLabel invisibleLabel = new JLabel();
invisibleLabel.setPreferredSize(new JLabel("Location: ").getPreferredSize());
panel.add(invisibleLabel, BorderLayout.WEST);
myInfoPanel = new JPanel(new VerticalFlowLayout());
myAuthorLabel = new JLabel();
myDescriptionPane = new JTextPane();
myDescriptionPane.setEditable(true);
myDescriptionPane.setEnabled(true);
myAuthorLabel.setEnabled(true);
myDescriptionPane.setPreferredSize(new Dimension(150, 200));
myDescriptionPane.setFont(coursesCombo.getFont());
myInfoPanel.add(myAuthorLabel);
myInfoPanel.add(new JBScrollPane(myDescriptionPane));
panel.add(myInfoPanel, BorderLayout.CENTER);
add(panel);
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class StudySwingToolWindow method createTaskInfoPanel.
@Override
public JComponent createTaskInfoPanel(Project project) {
myTaskTextPane = new JTextPane();
final JBScrollPane scrollPane = new JBScrollPane(myTaskTextPane);
myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
int fontSize = editorColorsScheme.getEditorFontSize();
final String fontName = editorColorsScheme.getEditorFontName();
final Font font = new Font(fontName, Font.PLAIN, fontSize);
String bodyRule = "body { font-family: " + font.getFamily() + "; " + "font-size: " + font.getSize() + "pt; }" + "pre {font-family: Courier; display: inline; ine-height: 50px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; background-color:" + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}" + "code {font-family: Courier; display: flex; float: left; background-color:" + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}";
((HTMLDocument) myTaskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
myTaskTextPane.setEditable(false);
if (!UIUtil.isUnderDarcula()) {
myTaskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
}
myTaskTextPane.setBorder(new EmptyBorder(20, 20, 0, 10));
myTaskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
return scrollPane;
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class CodeStyleHtmlPanel method createUIComponents.
private void createUIComponents() {
myRightMarginForm = new RightMarginForm(StdFileTypes.HTML.getLanguage(), getSettings());
myRightMarginPanel = myRightMarginForm.getTopPanel();
myJBScrollPane = new JBScrollPane() {
@Override
public Dimension getPreferredSize() {
Dimension prefSize = super.getPreferredSize();
return new Dimension(prefSize.width + 15, prefSize.height);
}
};
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class CodeStyleXmlPanel method createUIComponents.
private void createUIComponents() {
myJBScrollPane = new JBScrollPane() {
@Override
public Dimension getPreferredSize() {
Dimension prefSize = super.getPreferredSize();
return new Dimension(prefSize.width + 15, prefSize.height);
}
};
myRightMarginForm = new RightMarginForm(StdFileTypes.XML.getLanguage(), getSettings());
myRightMarginPanel = myRightMarginForm.getTopPanel();
}
use of com.intellij.ui.components.JBScrollPane in project azure-tools-for-java by Microsoft.
the class ServerExplorerToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
// initialize azure service module
AzureModule azureModule = new AzureModuleImpl(project);
HDInsightUtil.setHDInsightRootModule(azureModule);
// initialize with all the service modules
DefaultTreeModel treeModel = new DefaultTreeModel(initRoot(project, azureModule));
treeModelMap.put(project, treeModel);
// initialize tree
final JTree tree = new Tree(treeModel);
tree.setRootVisible(false);
tree.setCellRenderer(new NodeTreeCellRenderer());
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
// add a click handler for the tree
tree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
treeMousePressed(e, tree);
}
});
// add the tree to the window
toolWindow.getComponent().add(new JBScrollPane(tree));
// setup toolbar icons
addToolbarItems(toolWindow, azureModule);
// try {
// azureModule.registerSubscriptionsChanged();
// } catch (AzureCmdException ignored) {
// }
}
Aggregations