use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class RootsAndBranches method createPanels.
private void createPanels(final RepositoryLocation location, final Runnable afterRefresh) {
final Task.Backgroundable backgroundable = new Task.Backgroundable(myProject, "Subversion: loading working copies data..", false) {
public void run(@NotNull final ProgressIndicator indicator) {
indicator.setIndeterminate(true);
final Map<String, SvnMergeInfoRootPanelManual> panels = new HashMap<>();
final Map<String, MergeInfoHolder> holders = new HashMap<>();
final List<WCInfoWithBranches> roots = myDataLoader.loadRoots();
SwingUtilities.invokeLater(() -> {
if (myDisposed)
return;
final JPanel mainPanel = prepareData(panels, holders, roots);
myMergePanels.clear();
myHolders.clear();
myMergePanels.putAll(panels);
myHolders.putAll(holders);
if (myPanelWrapper != null) {
myPanelWrapper.removeAll();
if (myMergePanels.isEmpty()) {
final JPanel emptyPanel = new JPanel(new GridBagLayout());
final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0);
final JLabel label = new JLabel("No Subversion 1.5 working copies\nof 1.5 repositories in the project");
label.setUI(new MultiLineLabelUI());
emptyPanel.add(label, gb);
gb.fill = GridBagConstraints.HORIZONTAL;
myPanelWrapper.add(emptyPanel, gb);
} else {
for (MergeInfoHolder holder : myHolders.values()) {
holder.updateMixedRevisionsForPanel();
}
myPanelWrapper.add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
}
myPanelWrapper.repaint();
} else {
myPanel = mainPanel;
}
if (afterRefresh != null) {
afterRefresh.run();
}
});
}
};
ProgressManager.getInstance().run(backgroundable);
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class UpgradeFormatDialog method createCenterPanel.
@Nullable
protected JComponent createCenterPanel() {
JPanel panel = new JPanel();
panel.setLayout(new GridBagLayout());
GridBagConstraints gb = new GridBagConstraints();
// top label.
gb.insets = JBUI.insets(2);
gb.weightx = 1;
gb.weighty = 0;
gb.gridwidth = 2;
gb.gridheight = 1;
gb.gridx = 0;
gb.gridy = 0;
gb.anchor = GridBagConstraints.WEST;
gb.fill = GridBagConstraints.HORIZONTAL;
File adminPath = new File(myPath, SVNFileUtil.getAdminDirectoryName());
final boolean adminPathIsDirectory = adminPath.isDirectory();
final String label = getMiddlePartOfResourceKey(adminPathIsDirectory);
JLabel topLabel = new JLabel(getTopMessage(label));
topLabel.setUI(new MultiLineLabelUI());
panel.add(topLabel, gb);
gb.gridy += 1;
registerFormat(WorkingCopyFormat.ONE_DOT_SIX, label, panel, gb);
registerFormat(WorkingCopyFormat.ONE_DOT_SEVEN, label, panel, gb);
registerFormat(WorkingCopyFormat.ONE_DOT_EIGHT, label, panel, gb);
final JPanel auxiliaryPanel = getBottomAuxiliaryPanel();
if (auxiliaryPanel != null) {
panel.add(auxiliaryPanel, gb);
gb.gridy += 1;
}
myLoadingPanel = new JBLoadingPanel(new BorderLayout(), getDisposable());
myLoadingPanel.add(panel, BorderLayout.CENTER);
return myLoadingPanel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class RootsDetectionStep method createResultsPanel.
protected JComponent createResultsPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
myDetectedRootsChooser = new DetectedRootsChooser();
myDetectedRootsChooser.addSelectionListener(new DetectedRootsChooser.RootSelectionListener() {
@Override
public void selectionChanged() {
updateSelectedTypes();
}
});
final String text = IdeBundle.message("label.project.roots.have.been.found");
final JLabel label = new JLabel(text);
label.setUI(new MultiLineLabelUI());
panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10, 0, 10), 0, 0));
panel.add(myDetectedRootsChooser.getComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBUI.insets(8, 10), 0, 0));
final JButton markAllButton = new JButton(IdeBundle.message("button.mark.all"));
panel.add(markAllButton, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(0, 10, 8, 2), 0, 0));
final JButton unmarkAllButton = new JButton(IdeBundle.message("button.unmark.all"));
panel.add(unmarkAllButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(0, 0, 8, 10), 0, 0));
markAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
myDetectedRootsChooser.setAllElementsMarked(true);
}
});
unmarkAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
myDetectedRootsChooser.setAllElementsMarked(false);
}
});
myResultPanel = new JPanel(new CardLayout());
myResultPanel.add(ROOTS_FOUND_CARD, panel);
JPanel notFoundPanel = new JPanel(new BorderLayout());
notFoundPanel.setBorder(IdeBorderFactory.createEmptyBorder(5));
notFoundPanel.add(BorderLayout.NORTH, new MultiLineLabel(IdeBundle.message("label.project.roots.not.found")));
myResultPanel.add(ROOTS_NOT_FOUND_CARD, notFoundPanel);
return myResultPanel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class SourcePathsStep method createComponentForChooseSources.
private JComponent createComponentForChooseSources() {
final JPanel panel = new JPanel(new GridBagLayout());
mySourcePathsChooser = new ElementsChooser<JavaModuleSourceRoot>(true) {
public String getItemText(@NotNull JavaModuleSourceRoot sourceRoot) {
StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
builder.append(sourceRoot.getDirectory().getAbsolutePath());
final String packagePrefix = sourceRoot.getPackagePrefix();
if (!packagePrefix.isEmpty()) {
builder.append(" (").append(packagePrefix).append(")");
}
builder.append(" [").append(sourceRoot.getRootTypeName()).append("]");
return builder.toString();
} finally {
StringBuilderSpinAllocator.dispose(builder);
}
}
};
final String text = IdeBundle.message("label.java.source.files.have.been.found");
final JLabel label = new JLabel(text);
label.setUI(new MultiLineLabelUI());
panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10, 0, 10), 0, 0));
panel.add(mySourcePathsChooser, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBUI.insets(8, 10), 0, 0));
final JButton markAllButton = new JButton(IdeBundle.message("button.mark.all"));
panel.add(markAllButton, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(0, 10, 8, 2), 0, 0));
final JButton unmarkAllButton = new JButton(IdeBundle.message("button.unmark.all"));
panel.add(unmarkAllButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(0, 0, 8, 10), 0, 0));
markAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
mySourcePathsChooser.setAllElementsMarked(true);
}
});
unmarkAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
mySourcePathsChooser.setAllElementsMarked(false);
}
});
return panel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class RefactoringMessageDialog method createNorthPanel.
@Override
protected JComponent createNorthPanel() {
JLabel label = new JLabel(myMessage);
label.setUI(new MultiLineLabelUI());
JPanel panel = new JPanel(new BorderLayout(10, 0));
if (myIcon != null) {
panel.add(new JLabel(myIcon), BorderLayout.WEST);
panel.add(label, BorderLayout.CENTER);
} else {
panel.add(label, BorderLayout.WEST);
}
return panel;
}
Aggregations