use of com.intellij.ui.roots.IconActionComponent in project intellij-community by JetBrains.
the class JavaSourceRootEditHandlerBase method createPropertiesEditor.
@Nullable
@Override
public JComponent createPropertiesEditor(@NotNull final SourceFolder folder, @NotNull final JComponent parentComponent, @NotNull final ContentRootPanel.ActionCallback callback) {
final IconActionComponent iconComponent = new IconActionComponent(AllIcons.Modules.SetPackagePrefix, AllIcons.Modules.SetPackagePrefixRollover, ProjectBundle.message("module.paths.edit.properties.tooltip"), () -> {
JavaSourceRootProperties properties = folder.getJpsElement().getProperties(JavaModuleSourceRootTypes.SOURCES);
assert properties != null;
SourceRootPropertiesDialog dialog = new SourceRootPropertiesDialog(parentComponent, properties);
if (dialog.showAndGet()) {
callback.onSourceRootPropertiesChanged(folder);
}
});
final JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false);
panel.add(iconComponent, BorderLayout.CENTER);
panel.add(Box.createHorizontalStrut(3), BorderLayout.EAST);
return panel;
}
use of com.intellij.ui.roots.IconActionComponent in project intellij-community by JetBrains.
the class JavaResourceRootEditHandlerBase method createPropertiesEditor.
@Nullable
@Override
public JComponent createPropertiesEditor(@NotNull final SourceFolder folder, @NotNull final JComponent parentComponent, @NotNull final ContentRootPanel.ActionCallback callback) {
final IconActionComponent iconComponent = new IconActionComponent(AllIcons.Modules.SetPackagePrefix, AllIcons.Modules.SetPackagePrefixRollover, ProjectBundle.message("module.paths.edit.properties.tooltip"), () -> {
JavaResourceRootProperties properties = folder.getJpsElement().getProperties(JavaModuleSourceRootTypes.RESOURCES);
assert properties != null;
ResourceRootPropertiesDialog dialog = new ResourceRootPropertiesDialog(parentComponent, properties);
if (dialog.showAndGet()) {
callback.onSourceRootPropertiesChanged(folder);
}
});
final JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false);
panel.add(iconComponent, BorderLayout.CENTER);
panel.add(Box.createHorizontalStrut(3), BorderLayout.EAST);
return panel;
}
use of com.intellij.ui.roots.IconActionComponent in project intellij-community by JetBrains.
the class ContentRootPanel method createHeader.
private JComponent createHeader() {
final JPanel panel = new JPanel(new GridBagLayout());
final JLabel headerLabel = new JLabel(toDisplayPath(getContentEntry().getUrl()));
headerLabel.setFont(headerLabel.getFont().deriveFont(Font.BOLD));
headerLabel.setOpaque(false);
if (getContentEntry().getFile() == null) {
headerLabel.setForeground(JBColor.RED);
}
final IconActionComponent deleteIconComponent = new IconActionComponent(AllIcons.Modules.DeleteContentRoot, AllIcons.Modules.DeleteContentRootRollover, ProjectBundle.message("module.paths.remove.content.tooltip"), () -> myCallback.deleteContentEntry());
final ResizingWrapper wrapper = new ResizingWrapper(headerLabel);
panel.add(wrapper, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insetsLeft(2), 0, 0));
panel.add(deleteIconComponent, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.NONE, JBUI.insetsRight(5), 0, 0));
FilePathClipper.install(headerLabel, wrapper);
return panel;
}
Aggregations