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


Java LinkMouseListenerBase类代码示例

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


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

示例1: getComponent

import com.intellij.openapi.vcs.changes.issueLinks.LinkMouseListenerBase; //导入依赖的package包/类
@NotNull
@Override
public JComponent getComponent(@NotNull final DiffContext context) {
  final SimpleColoredComponent label = new SimpleColoredComponent();
  label.append("Can't show diff for unknown file type. ",
               new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getInactiveTextColor()));
  if (myFileName != null) {
    label.append("Associate", SimpleTextAttributes.LINK_ATTRIBUTES, new Runnable() {
      @Override
      public void run() {
        DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() {
          @Override
          public void run() {
            FileType type = FileTypeChooser.associateFileType(myFileName);
            if (type != null) onSuccess(context);
          }
        });
      }
    });
    LinkMouseListenerBase.installSingleTagOn(label);
  }
  return DiffUtil.createMessagePanel(label);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:UnknownFileTypeDiffRequest.java

示例2: getComponent

import com.intellij.openapi.vcs.changes.issueLinks.LinkMouseListenerBase; //导入依赖的package包/类
@Nonnull
@Override
public JComponent getComponent(@Nonnull final DiffContext context) {
  final SimpleColoredComponent label = new SimpleColoredComponent();
  label.setTextAlign(SwingConstants.CENTER);
  label.append("Can't show diff for unknown file type. ",
               new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getInactiveTextColor()));
  if (myFileName != null) {
    label.append("Associate", SimpleTextAttributes.LINK_ATTRIBUTES, new Runnable() {
      @Override
      public void run() {
        FileType type = FileTypeChooser.associateFileType(myFileName);
        if (type != null) onSuccess(context);
      }
    });
    LinkMouseListenerBase.installSingleTagOn(label);
  }
  return JBUI.Panels.simplePanel(label).withBorder(JBUI.Borders.empty(5));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:UnknownFileTypeDiffRequest.java

示例3: RepositoryAuthenticationForm

import com.intellij.openapi.vcs.changes.issueLinks.LinkMouseListenerBase; //导入依赖的package包/类
public RepositoryAuthenticationForm(@NotNull String message, @Nullable String token, @Nullable String password, @Nullable String note, boolean onlyPassword) {
  super(false);

  setTitle("Settings Repository");
  setResizable(false);

  messageLabel.setText(message);
  messageLabel.setBorder(new EmptyBorder(0, 0, 10, 0));

  if (onlyPassword) {
    tokenLabel.setVisible(false);
    tokenField.setVisible(false);

    passwordField.getDocument().addDocumentListener(new DocumentAdapter() {
      @Override
      protected void textChanged(DocumentEvent e) {
        setOKActionEnabled(e.getDocument().getLength() != 0);
      }
    });
    initialFocusedComponent = passwordField;
    setOKActionEnabled(false);
  }
  else {
    tokenField.setText(token);
    passwordField.setText(password);
    initialFocusedComponent = StringUtil.isEmpty(token) ? tokenField : passwordField;
  }

  if (note == null) {
    noteComponent.setVisible(false);
  }
  else {
    Matcher matcher = HREF_PATTERN.matcher(note);
    int prev = 0;
    if (matcher.find()) {
      do {
        if (matcher.start() != prev) {
          noteComponent.append(note.substring(prev, matcher.start()), SMALL_TEXT_ATTRIBUTES);
        }
        noteComponent.append(matcher.group(2), LINK_TEXT_ATTRIBUTES, new SimpleColoredComponent.BrowserLauncherTag(matcher.group(1)));
        prev = matcher.end();
      }
      while (matcher.find());

      LinkMouseListenerBase.installSingleTagOn(noteComponent);
    }

    if (prev < note.length()) {
      noteComponent.append(note.substring(prev), SMALL_TEXT_ATTRIBUTES);
    }
  }

  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:RepositoryAuthenticationForm.java


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