Java 类com.intellij.ui.roots.FilePathClipper 实例源码

项目:intellij-ce-playground    文件:ContentRootPanel.java   
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"), new Runnable() {
    @Override
    public void run() {
      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, new Insets(0, 2, 0, 0), 0, 0));
  panel.add(deleteIconComponent, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 2), 0, 0));
  FilePathClipper.install(headerLabel, wrapper);
  return panel;
}
项目:tools-idea    文件:ContentRootPanel.java   
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(Color.RED);
  }
  final IconActionComponent deleteIconComponent = new IconActionComponent(AllIcons.Modules.DeleteContentRoot,
                                                                          AllIcons.Modules.DeleteContentRootRollover,
                                                                          ProjectBundle.message("module.paths.remove.content.tooltip"), new Runnable() {
    @Override
    public void run() {
      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, new Insets(0, 2, 0, 0), 0, 0));
  panel.add(deleteIconComponent, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 2), 0, 0));
  FilePathClipper.install(headerLabel, wrapper);
  return panel;
}
项目:consulo    文件:ContentRootPanel.java   
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(Color.RED);
  }
  final IconActionComponent deleteIconComponent =
    new IconActionComponent(AllIcons.Modules.DeleteContentRoot, AllIcons.Modules.DeleteContentRootRollover,
                            ProjectBundle.message("module.paths.remove.content.tooltip"), new Runnable() {
      @Override
      public void run() {
        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, new Insets(0, 2, 0, 0), 0, 0));
  panel.add(deleteIconComponent,
            new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
                                   new Insets(0, 0, 0, 2), 0, 0));
  FilePathClipper.install(headerLabel, wrapper);
  return panel;
}
项目:intellij-ce-playground    文件:ContentRootPanel.java   
public UnderlinedPathLabel(JLabel wrappedComponent) {
  super(wrappedComponent);
  FilePathClipper.install(wrappedComponent, this);
}
项目:tools-idea    文件:ContentRootPanel.java   
public UnderlinedPathLabel(JLabel wrappedComponent) {
  super(wrappedComponent);
  FilePathClipper.install(wrappedComponent, this);
}
项目:consulo    文件:ContentRootPanel.java   
public UnderlinedPathLabel(JLabel wrappedComponent) {
  super(wrappedComponent);
  FilePathClipper.install(wrappedComponent, this);
}