コード例 #1
0
 private String createXDGDirectory(String menuName, String icon, String comment) {
   String menuDirectoryDescriptor =
       "[Desktop Entry]\n"
           + "Name=$Name\n"
           + "Comment=$Comment\n"
           + "Icon=$Icon\n"
           + "Type=Directory\n"
           + "Encoding=UTF-8";
   menuDirectoryDescriptor = StringTool.replace(menuDirectoryDescriptor, "$Name", menuName);
   menuDirectoryDescriptor = StringTool.replace(menuDirectoryDescriptor, "$Comment", comment);
   menuDirectoryDescriptor = StringTool.replace(menuDirectoryDescriptor, "$Icon", icon);
   return menuDirectoryDescriptor;
 }
コード例 #2
0
  /**
   * Helper to format a message to create shortcuts for the current platform.
   *
   * @return a formatted message
   */
  public String getCreateShortcutsPrompt() {
    Messages messages = installData.getMessages();
    String menuKind = messages.get("ShortcutPanel.regular.StartMenu:Start-Menu");

    if (installData.getPlatform().isA(UNIX) && UnixHelper.kdeIsInstalled()) {
      menuKind = messages.get("ShortcutPanel.regular.StartMenu:K-Menu");
    }

    return StringTool.replace(messages.get("ShortcutPanel.regular.create"), "StartMenu", menuKind);
  }