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


Java ApplicationNamesInfo类代码示例

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


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

示例1: send

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public static void send()
{
    SourcetrailOptions options = SourcetrailOptions.getInstance();
    try
    {
        String text = "ping>>" + ApplicationNamesInfo.getInstance().getFullProductName() + "<EOM>";
        Socket socket = new Socket(options.getIp(), options.getSourcetrailPort());
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        writer.write(text);
        writer.flush();
        socket.close();
    }
    catch(Exception e)
    {
        String errorMsg =
                "No connection to a Sourcetrail instance\n\n Make sure Sourcetrail is running and the right address is used("
                        + options.getIp() + ":" + options.getSourcetrailPort() + ")";
        Messages.showMessageDialog(errorMsg, "SourcetrailPluginError", Messages.getErrorIcon());
        e.printStackTrace();

    }

}
 
开发者ID:CoatiSoftware,项目名称:idea-sourcetrail,代码行数:24,代码来源:Ping.java

示例2: sendHtmlResponse

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
private void sendHtmlResponse(@NotNull HttpRequest request, @NotNull ChannelHandlerContext context, String pagePath) throws IOException {
  BufferExposingByteArrayOutputStream byteOut = new BufferExposingByteArrayOutputStream();
  InputStream pageTemplateStream = getClass().getResourceAsStream(pagePath);
  String pageTemplate = StreamUtil.readText(pageTemplateStream, Charset.forName("UTF-8"));
  try {
    String pageWithProductName = pageTemplate.replaceAll("%IDE_NAME", ApplicationNamesInfo.getInstance().getFullProductName());
    byteOut.write(StreamUtil.loadFromStream(new ByteArrayInputStream(pageWithProductName.getBytes(Charset.forName("UTF-8")))));
    HttpResponse response = Responses.response("text/html", Unpooled.wrappedBuffer(byteOut.getInternalBuffer(), 0, byteOut.size()));
    Responses.addNoCache(response);
    response.headers().set("X-Frame-Options", "Deny");
    Responses.send(response, context.channel(), request);
  }
  finally {
    byteOut.close();
    pageTemplateStream.close();
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:18,代码来源:EduStepikRestService.java

示例3: processDuplicates

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public static void processDuplicates(@NotNull MatchProvider provider, @NotNull Project project, @NotNull Editor editor) {
  Boolean hasDuplicates = provider.hasDuplicates();
  if (hasDuplicates == null || hasDuplicates.booleanValue()) {
    List<Match> duplicates = provider.getDuplicates();
    if (duplicates.size() == 1) {
      previewMatch(project, duplicates.get(0), editor);
    }
    final int answer = ApplicationManager.getApplication().isUnitTestMode() || hasDuplicates == null ? Messages.YES : Messages.showYesNoDialog(project,
      RefactoringBundle.message("0.has.detected.1.code.fragments.in.this.file.that.can.be.replaced.with.a.call.to.extracted.method",
      ApplicationNamesInfo.getInstance().getProductName(), duplicates.size()),
      "Process Duplicates", Messages.getQuestionIcon());
    if (answer == Messages.YES) {
      PsiDocumentManager.getInstance(project).commitAllDocuments();
      invoke(project, editor, provider, hasDuplicates != null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DuplicatesImpl.java

示例4: getAdditionalSettings

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public JComponent getAdditionalSettings(final WizardContext wizardContext) {
  JTextField tfModuleFilePath = new JTextField();
  final String productName = ApplicationNamesInfo.getInstance().getProductName();
  final String message = IdeBundle.message("prompt.select.module.file.to.import", productName);
  final BrowseFilesListener listener = new BrowseFilesListener(tfModuleFilePath, message, null, new ModuleFileChooserDescriptor()) {
    @Override
    protected VirtualFile getFileToSelect() {
      final VirtualFile fileToSelect = super.getFileToSelect();
      if (fileToSelect != null) {
        return fileToSelect;
      }
      final Project project = wizardContext.getProject();
      return project != null ? project.getBaseDir() : null;
    }
  };
  myModulePathFieldPanel = new TextFieldWithBrowseButton(tfModuleFilePath, listener);
  onChosen(false);
  return myModulePathFieldPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ImportImlMode.java

示例5: FrameworkDetectionStep

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public FrameworkDetectionStep(final Icon icon, final ProjectFromSourcesBuilder builder) {
  super(ProjectBundle.message("message.text.stop.searching.for.frameworks", ApplicationNamesInfo.getInstance().getProductName()));
  myIcon = icon;
  myContext = new FrameworkDetectionInWizardContext() {
    @Override
    protected List<ModuleDescriptor> getModuleDescriptors() {
      return FrameworkDetectionStep.this.getModuleDescriptors();
    }

    @Override
    protected String getContentPath() {
      return builder.getBaseProjectPath();
    }
  };
  myDetectedFrameworksComponent = new DetectedFrameworksComponent(myContext);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FrameworkDetectionStep.java

示例6: createDirectoryIfNotExists

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public static boolean createDirectoryIfNotExists(final String promptPrefix, String directoryPath, boolean promptUser) {
  File dir = new File(directoryPath);
  if (!dir.exists()) {
    if (promptUser) {
      final int answer = Messages.showOkCancelDialog(IdeBundle.message("promot.projectwizard.directory.does.not.exist", promptPrefix,
                                                                       dir.getPath(), ApplicationNamesInfo.getInstance().getFullProductName()),
                                                     IdeBundle.message("title.directory.does.not.exist"), Messages.getQuestionIcon());
      if (answer != Messages.OK) {
        return false;
      }
    }
    try {
      VfsUtil.createDirectories(dir.getPath());
    }
    catch (IOException e) {
      Messages.showErrorDialog(IdeBundle.message("error.failed.to.create.directory", dir.getPath()), CommonBundle.getErrorTitle());
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ProjectWizardUtil.java

示例7: createNotification

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public static Notification createNotification(@NotNull final String groupDisplayId, @Nullable NotificationListener listener) {

    final String productName = ApplicationNamesInfo.getInstance().getProductName();

    Window recentFocusedWindow = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();

    String text =
      "<html>We have found out that you are using a non-english keyboard layout. You can <a href='enable'>enable</a> smart layout support for " +
      KeyboardSettingsExternalizable.getDisplayLanguageNameForComponent(recentFocusedWindow) + " language." +
      "You can change this option in the settings of " + productName + " <a href='settings'>more...</a></html>";

    String title = "Enable smart keyboard internalization for " + productName + ".";

    return new Notification(groupDisplayId, title,
                            text,
                            NotificationType.INFORMATION,
                            listener);
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:KeyboardInternationalizationNotificationManager.java

示例8: LibNotifyWrapper

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
private LibNotifyWrapper() {
  myLibNotify = (LibNotify)Native.loadLibrary("libnotify.so.4", LibNotify.class);

  String appName = ApplicationNamesInfo.getInstance().getProductName();
  if (myLibNotify.notify_init(appName) == 0) {
    throw new IllegalStateException("notify_init failed");
  }

  String icon = AppUIUtil.findIcon(PathManager.getBinPath());
  myIcon = icon != null ? icon : "dialog-information";

  MessageBusConnection connection = ApplicationManager.getApplication().getMessageBus().connect();
  connection.subscribe(AppLifecycleListener.TOPIC, new AppLifecycleListener.Adapter() {
    @Override
    public void appClosing() {
      synchronized (myLock) {
        myDisposed = true;
        myLibNotify.notify_uninit();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LibNotifyWrapper.java

示例9: createNotification

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
@Override
public Notification createNotification(@NotNull final String groupDisplayId, @Nullable NotificationListener listener) {
  final String fullProductName = ApplicationNamesInfo.getInstance().getFullProductName();
  final String companyName = ApplicationInfo.getInstance().getCompanyName();

  String text =
    "<html>Please click <a href='allow'>I agree</a> if you want to help make " + fullProductName +
    " better or <a href='decline'>I don't agree</a> otherwise. <a href='settings'>more...</a></html>";

  String title = "Help improve " + fullProductName + " by sending anonymous usage statistics to " + companyName;

  return new Notification(groupDisplayId, title,
                          text,
                          NotificationType.INFORMATION,
                          listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:RemotelyConfigurableStatisticsService.java

示例10: startLogging

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
private static void startLogging(final Logger log) {
  Runtime.getRuntime().addShutdownHook(new Thread("Shutdown hook - logging") {
    @Override
    public void run() {
      log.info("------------------------------------------------------ IDE SHUTDOWN ------------------------------------------------------");
    }
  });
  log.info("------------------------------------------------------ IDE STARTED ------------------------------------------------------");

  ApplicationInfo appInfo = ApplicationInfoImpl.getShadowInstance();
  ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
  String buildDate = new SimpleDateFormat("dd MMM yyyy HH:ss", Locale.US).format(appInfo.getBuildDate().getTime());
  log.info("IDE: " + namesInfo.getFullProductName() + " (build #" + appInfo.getBuild().asStringWithAllDetails() + ", " + buildDate + ")");
  log.info("OS: " + SystemInfoRt.OS_NAME + " (" + SystemInfoRt.OS_VERSION + ", " + SystemInfo.OS_ARCH + ")");
  log.info("JRE: " + System.getProperty("java.runtime.version", "-") + " (" + System.getProperty("java.vendor", "-") + ")");
  log.info("JVM: " + System.getProperty("java.vm.version", "-") + " (" + System.getProperty("java.vm.name", "-") + ")");

  List<String> arguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
  if (arguments != null) {
    log.info("JVM Args: " + StringUtil.join(arguments, " "));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:StartupUtil.java

示例11: CustomizeIDEWizardDialog

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public CustomizeIDEWizardDialog() {
  super(null, true, true);
  setTitle("Customize " + ApplicationNamesInfo.getInstance().getProductName());
  getPeer().setAppIcons();
  initSteps();
  mySkipButton.addActionListener(this);
  myBackButton.addActionListener(this);
  myNextButton.addActionListener(this);
  AbstractCustomizeWizardStep.applyHeaderFooterStyle(myNavigationLabel);
  AbstractCustomizeWizardStep.applyHeaderFooterStyle(myHeaderLabel);
  AbstractCustomizeWizardStep.applyHeaderFooterStyle(myFooterLabel);
  init();
  initCurrentStep(true);
  setSize(400, 300);
  System.setProperty(StartupActionScriptManager.STARTUP_WIZARD_MODE, "true");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CustomizeIDEWizardDialog.java

示例12: prevTip

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public void prevTip() {
  if (myTips.size() == 0) {
    myBrowser.setText(IdeBundle.message("error.tips.not.found", ApplicationNamesInfo.getInstance().getFullProductName()));
    return;
  }
  final GeneralSettings settings = GeneralSettings.getInstance();
  int lastTip = settings.getLastTip();

  final TipAndTrickBean tip;
  lastTip--;
  if (lastTip <= 0) {
    tip = myTips.get(myTips.size() - 1);
    lastTip = myTips.size();
  }
  else {
    tip = myTips.get(lastTip - 1);
  }

  setTip(tip, lastTip, myBrowser, settings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:TipPanel.java

示例13: nextTip

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public void nextTip() {
  if (myTips.size() == 0) {
    myBrowser.setText(IdeBundle.message("error.tips.not.found", ApplicationNamesInfo.getInstance().getFullProductName()));
    return;
  }
  GeneralSettings settings = GeneralSettings.getInstance();
  int lastTip = settings.getLastTip();
  TipAndTrickBean tip;
  lastTip++;
  if (lastTip - 1 >= myTips.size()) {
    tip = myTips.get(0);
    lastTip = 1;
  }
  else {
    tip = myTips.get(lastTip - 1);
  }

  setTip(tip, lastTip, myBrowser, settings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TipPanel.java

示例14: doGetSettingsFilePath

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
@NotNull
private static String doGetSettingsFilePath(boolean customLocation) {
  final String vmOptionsFile = System.getProperty("jb.vmOptionsFile");
  if (!StringUtil.isEmptyOrSpaces(vmOptionsFile)) {
    return vmOptionsFile;
  }

  if (SystemInfo.isMac) {
    if (customLocation) {
      return PathManager.getConfigPath() + "/idea.vmoptions";
    }
    else {
      return PathManager.getBinPath() + "/idea.vmoptions";
    }
  }

  final String productName = ApplicationNamesInfo.getInstance().getProductName().toLowerCase(Locale.US);
  final String platformSuffix = SystemInfo.is64Bit ? "64" : "";
  final String osSuffix = SystemInfo.isWindows ? ".exe" : "";
  return PathManager.getBinPath() + File.separatorChar + productName + platformSuffix + osSuffix + ".vmoptions";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:VMOptions.java

示例15: init

import com.intellij.openapi.application.ApplicationNamesInfo; //导入依赖的package包/类
public void init(final Convertor<String, VcsShowConfirmationOption.Value> initOptions) {
  createSettingFor(VcsConfiguration.StandardOption.ADD);
  createSettingFor(VcsConfiguration.StandardOption.REMOVE);
  createSettingFor(VcsConfiguration.StandardOption.CHECKOUT);
  createSettingFor(VcsConfiguration.StandardOption.UPDATE);
  createSettingFor(VcsConfiguration.StandardOption.STATUS);
  createSettingFor(VcsConfiguration.StandardOption.EDIT);

  myConfirmations.put(VcsConfiguration.StandardConfirmation.ADD.getId(), new VcsShowConfirmationOptionImpl(
    VcsConfiguration.StandardConfirmation.ADD.getId(),
    VcsBundle.message("label.text.when.files.created.with.idea", ApplicationNamesInfo.getInstance().getProductName()),
    VcsBundle.message("radio.after.creation.do.not.add"), VcsBundle.message("radio.after.creation.show.options"),
    VcsBundle.message("radio.after.creation.add.silently")));

  myConfirmations.put(VcsConfiguration.StandardConfirmation.REMOVE.getId(), new VcsShowConfirmationOptionImpl(
    VcsConfiguration.StandardConfirmation.REMOVE.getId(),
    VcsBundle.message("label.text.when.files.are.deleted.with.idea", ApplicationNamesInfo.getInstance().getProductName()),
    VcsBundle.message("radio.after.deletion.do.not.remove"), VcsBundle.message("radio.after.deletion.show.options"),
    VcsBundle.message("radio.after.deletion.remove.silently")));

  restoreReadConfirm(VcsConfiguration.StandardConfirmation.ADD, initOptions);
  restoreReadConfirm(VcsConfiguration.StandardConfirmation.REMOVE, initOptions);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:OptionsAndConfirmations.java


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