当前位置: 首页>>代码示例>>Java>>正文


Java LinkLabel类代码示例

本文整理汇总了Java中com.intellij.ui.components.labels.LinkLabel的典型用法代码示例。如果您正苦于以下问题:Java LinkLabel类的具体用法?Java LinkLabel怎么用?Java LinkLabel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LinkLabel类属于com.intellij.ui.components.labels包,在下文中一共展示了LinkLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupPathComponent

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
private void setupPathComponent(final JPanel northPanel) {
  northPanel.add(new TextFieldAction() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      toggleShowPathComponent(northPanel, this);
    }
  }, BorderLayout.EAST);
  myPathEditor = new EditorTextField(JavaReferenceEditorUtil.createDocument("", myProject, false), myProject, StdFileTypes.JAVA);
  myPathEditor.addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      myAlarm.cancelAllRequests();
      myAlarm.addRequest(new Runnable() {
        @Override
        public void run() {
          updateTreeFromPath();
        }
      }, 300);
    }
  });
  myPathEditor.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0));
  northPanel.add(myPathEditor, BorderLayout.SOUTH);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:PackageChooserDialog.java

示例2: addAction

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public void addAction(final Action action) {
  action.addPropertyChangeListener(this);
  final LinkLabel label = new LinkLabel(null, null, new LinkListener() {
    @Override
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      action.actionPerformed(new ActionEvent(Banner.this, ActionEvent.ACTION_PERFORMED, Action.ACTION_COMMAND_KEY));
    }
  }) {
    @Override
    protected Color getTextColor() {
      return PlatformColors.BLUE;
    }
  };
  label.setFont(label.getFont().deriveFont(Font.BOLD));
  myActions.put(action, label);
  myActionsPanel.add(label);
  updateAction(action);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:Banner.java

示例3: linkSelected

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
@Override
public void linkSelected(LinkLabel linkLabel, String command) {
  if (command == null || !command.contains(":")) return;
  int semicolonPosition = command.indexOf(":");
  String group = command.substring(semicolonPosition + 1);
  command = command.substring(0, semicolonPosition);

  if (SWITCH_COMMAND.equals(command)) {
    boolean enabled = isGroupEnabled(group);
    List<IdSet> sets = myPluginGroups.getSets(group);
    for (IdSet idSet : sets) {
      String[] ids = idSet.getIds();
      for (String id : ids) {
        myPluginGroups.setPluginEnabledWithDependencies(id, !enabled);
      }
    }
    repaint();
    return;
  }
  if (CUSTOMIZE_COMMAND.equals(command)) {
    myCustomizePanel.update(group);
    myCardLayout.show(this, CUSTOMIZE);
    setButtonsVisible(false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:CustomizePluginsStepPanel.java

示例4: IdSetPanel

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
private IdSetPanel() {
  setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, GAP, true, false));
  add(myTitleLabel);
  add(myContentPanel);
  JPanel buttonPanel = new JPanel(new GridBagLayout());
  GridBagConstraints gbc = new GridBagConstraints();
  gbc.insets.right = 25;
  gbc.gridy = 0;
  buttonPanel.add(mySaveButton, gbc);
  buttonPanel.add(new LinkLabel<String>("Enable All", null, this, "enable"), gbc);
  buttonPanel.add(new LinkLabel<String>("Disable All", null, this, "disable"), gbc);
  gbc.weightx = 1;
  buttonPanel.add(Box.createHorizontalGlue(), gbc);
  add(buttonPanel);
  mySaveButton.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      myCardLayout.show(CustomizePluginsStepPanel.this, MAIN);
      setButtonsVisible(true);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CustomizePluginsStepPanel.java

示例5: createStrategyPanel

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
private JComponent createStrategyPanel() {
  final JPanel labelPanel = new JPanel(new BorderLayout());
  labelPanel.setBackground(myTree.getBackground());
  final LinkLabel<String> linkLabel = new LinkLabel<String>("Edit all targets", null);
  linkLabel.setBorder(new EmptyBorder(2, 2, 2, 2));
  linkLabel.setListener(new LinkListener<String>() {
    @Override
    public void linkSelected(LinkLabel aSource, String aLinkData) {
      if (linkLabel.isEnabled()) {
        startSyncEditing();
      }
    }
  }, null);
  myTree.addPropertyChangeListener(PushLogTreeUtil.EDIT_MODE_PROP, new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      Boolean editMode = (Boolean)evt.getNewValue();
      linkLabel.setEnabled(!editMode);
      linkLabel.setPaintUnderline(!editMode);
      linkLabel.repaint();
    }
  });
  labelPanel.add(linkLabel, BorderLayout.EAST);
  return labelPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PushLog.java

示例6: createComponent

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
  final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  panel.add(myCheckbox);
  panel.add(myComboBox);
  panel.add(Box.createHorizontalStrut(UIUtil.DEFAULT_HGAP));
  panel.add(new LinkLabel("Manage Scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      Settings settings = Settings.KEY.getData(DataManager.getInstance().getDataContext(panel));
      if (settings != null) {
        settings.select(settings.find(ScopeChooserConfigurable.PROJECT_SCOPES));
      }
    }
  }));
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:VcsUpdateInfoScopeFilterConfigurable.java

示例7: createUIComponents

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
private void createUIComponents() {
  myLockOnDemand = new JCheckBox() {
    @Override
    public JToolTip createToolTip() {
      JToolTip toolTip = new JToolTip(){{
        setUI(new MultiLineTooltipUI());
      }};
      toolTip.setComponent(this);
      return toolTip;
    }
  };

  final SvnConfiguration configuration = SvnConfiguration.getInstance(myProject);
  int value = configuration.getMaxAnnotateRevisions();
  value = (value == -1) ? SvnConfiguration.ourMaxAnnotateRevisionsDefault : value;
  myNumRevsInAnnotations = new JSpinner(new SpinnerNumberModel(value, 10, 100000, 100));

  myNavigateToCommonProxyLink = new LinkLabel<Object>(SvnBundle.message("navigate.to.idea.proxy.settings"), null);

  final Long maximum = 30 * 60 * 1000L;
  final long connection = configuration.getSshConnectionTimeout() <= maximum ? configuration.getSshConnectionTimeout() : maximum;
  final long read = configuration.getSshReadTimeout() <= maximum ? configuration.getSshReadTimeout() : maximum;
  mySSHConnectionTimeout = new JSpinner(new SpinnerNumberModel(Long.valueOf(connection / 1000), Long.valueOf(0L), maximum, Long.valueOf(10L)));
  mySSHReadTimeout = new JSpinner(new SpinnerNumberModel(Long.valueOf(read / 1000), Long.valueOf(0L), maximum, Long.valueOf(10L)));
  myHttpTimeout = new JSpinner(new SpinnerNumberModel(Long.valueOf(read / 1000), Long.valueOf(0L), maximum, Long.valueOf(10L)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnConfigurable.java

示例8: ResultDialog

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public ResultDialog(String message, java.util.List<String> detail) {
    super(JOptionPane.getRootFrame(), message, true);

    final JPanel content = new JPanel();

 Box verticalBox = Box.createVerticalBox();

 for (int i  = 0; i < detail.size(); i++) {
  verticalBox.add(new JLabel(i + 1 + ". " + detail.get(0)));
  verticalBox.add(Box.createVerticalGlue());
 }

 final LinkLabel showMoreLink = createLinkLabel();
 verticalBox.add(showMoreLink);

 content.add(verticalBox);

    getContentPane().add(content, BorderLayout.NORTH);

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    pack();
    setResizable(false);
    setLocationRelativeTo(getOwner());

 addEscapeListener(this);
}
 
开发者ID:vlivanov,项目名称:translate-me,代码行数:27,代码来源:ResultDialog.java

示例9: addAction

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public void addAction(final Action action) {
  action.addPropertyChangeListener(this);
  final LinkLabel label = new LinkLabel(null, null, new LinkListener() {
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      action.actionPerformed(new ActionEvent(Banner.this, ActionEvent.ACTION_PERFORMED, Action.ACTION_COMMAND_KEY));
    }
  }) {
    @Override
    protected Color getTextColor() {
      return PlatformColors.BLUE;
    }
  };
  label.setFont(label.getFont().deriveFont(Font.BOLD));
  myActions.put(action, label);
  myActionsPanel.add(label);
  updateAction(action);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:Banner.java

示例10: createComponent

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
  final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  panel.add(myCheckbox);
  panel.add(myComboBox);
  panel.add(Box.createHorizontalStrut(UIUtil.DEFAULT_HGAP));
  panel.add(new LinkLabel("Edit scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      final OptionsEditor optionsEditor = OptionsEditor.KEY.getData(DataManager.getInstance().getDataContext(panel));
      if (optionsEditor != null) {
        SearchableConfigurable configurable = optionsEditor.findConfigurableById(new ScopeChooserConfigurable(myProject).getId());
        if (configurable != null) {
          optionsEditor.select(configurable);
        }
      }
    }
  }));
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:VcsUpdateInfoScopeFilterConfigurable.java

示例11: create

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
@Override
public JComponent create(final Project project) {
    JPanel requirementToolbar = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 2));
    LinkLabel gotoRequirement = new LinkLabel("", gotoIcon);
    requirementToolbar.add(gotoRequirement);
    final EntityContentPanel requirementPanel = new EntityContentPanel(project, "requirement", requirementToolbar);
    gotoRequirement.setListener(new LinkListener() {
        public void linkSelected(LinkLabel aSource, Object aLinkData) {
            HierarchicalChooser popupDialog = new HierarchicalChooser(project, "requirement", false, false, true, false, null);
            popupDialog.setVisible(true);
            String idStr = popupDialog.getSelectedValue();
            if(!idStr.isEmpty()) {
                requirementPanel.goTo(idStr);
            }
        }
    }, null);
    return requirementPanel;
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:19,代码来源:RequirementsContent.java

示例12: ColumnControls

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public ColumnControls(String col) {
    super(new GridLayout(1, 0, 5, 0));

    this.column = col;

    setBorder(new EmptyBorder(0, 0, 0, 5));

    moveDownLabel = new LinkLabel("", IconLoader.getIcon("/actions/sortDesc.png"), moveDown, col);
    add(moveDownLabel);
    moveUpLabel = new LinkLabel("", IconLoader.getIcon("/actions/sortAsc.png"), moveUp, col);
    add(moveUpLabel);
    deleteLabel = new LinkLabel("", IconLoader.getIcon("/modules/deleteContentFolder.png"), remove, col);
    add(deleteLabel);

    update();
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:17,代码来源:PropertyGrid.java

示例13: ColumnPanel

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public ColumnPanel(final EntityFilterPanel parent, String entityType, String property, T value, LinkListener listener) {
    this.entityType = entityType;
    this.property = property;
    nameLabel = new FieldNameLabel(entityType, property, parent.project.getComponent(MetadataService.class)) {
        @Override
        public Color getForeground() {
            return parent.isEnabled() ? SystemColor.textText : SystemColor.textInactiveText;
        }
    };
    valueLabel = new JLabel() {
        @Override
        public Color getForeground() {
            return parent.isEnabled() ? SystemColor.textText : SystemColor.textInactiveText;
        }
    };
    setValue(value);

    setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));

    add(nameLabel);
    add(valueLabel);

    if(parent.quickRemove) {
        add(new LinkLabel("", IconLoader.getIcon("/actions/clean.png"), listener, this));
    }
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:27,代码来源:EntityFilterPanel.java

示例14: EntityQueryPanel

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public EntityQueryPanel(final Project project, final EntityFilterModel<EntityQuery> model, final String entityType, final Set<String> hiddenFields, String delimiter, boolean showEmptyLabel, boolean showSection, boolean showIcon, boolean quickRemove) {
    super(project, model, entityType, delimiter, showEmptyLabel, showSection, quickRemove, false);

    crossLabel  = makeLabel("Cross-Filter:");
    crossLabel.setVisible(false);
    add(crossLabel);

    orderLabel = makeLabel("Order By:");
    orderLabel.setVisible(false);
    add(orderLabel);

    if(showIcon) {
        LinkLabel modifyFilterLink = new LinkLabel("", modifyFilterIcon, new LinkListener() {
            public void linkSelected(LinkLabel aSource, Object aLinkData) {
                EntityQuery updatedQuery = new EntityQueryDialog(project, entityType, model.getFilter(), "Filter:", hiddenFields).chooseQuery();
                if(updatedQuery != null) {
                    model.getFilter().copyFrom(updatedQuery);
                    model.fireFilterUpdated(true);
                }
            }
        });
        add(modifyFilterLink, 0);
    }

    loadMetadata();
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:27,代码来源:EntityQueryPanel.java

示例15: WarningPanel

import com.intellij.ui.components.labels.LinkLabel; //导入依赖的package包/类
public WarningPanel(JComponent comp, Color background, boolean canClose, boolean visible) {
    super(new FlowLayout(FlowLayout.LEFT, 2, 2));

    this.component = comp;

    comp.setBackground(Color.YELLOW);
    setBackground(Color.YELLOW);
    setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(2, 0, 2, 0, background), BorderFactory.createEtchedBorder()));
    add(new JLabel(IconLoader.getIcon("/general/balloonInformation.png")));
    add(comp);
    if(canClose) {
        LinkLabel warningCloseLink = new LinkLabel("", IconLoader.getIcon("/actions/closeNew.png"));
        warningCloseLink.setListener(new LinkListener() {
            @Override
            public void linkSelected(LinkLabel linkLabel, Object o) {
                setVisible(false);
            }
        }, null);
        add(warningCloseLink);
    }
    setVisible(visible);
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:23,代码来源:WarningPanel.java


注:本文中的com.intellij.ui.components.labels.LinkLabel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。