コード例 #1
0
 /*--------------------------------------------------------------------------*/
 public void setUserType(int type) {
   Debug.log(CLASS + myClass + ".setUserType() '" + type + "'");
   if (type == CURRENT_USER) {
     if (shortcut.getcurrentUserLinkPath().length() > 0) {
       shortcut.setUserType(ShellLink.CURRENT_USER);
     }
   } else if (type == ALL_USERS) {
     if (shortcut.getallUsersLinkPath().length() > 0) {
       shortcut.setUserType(ShellLink.ALL_USERS);
     }
   }
 }
コード例 #2
0
 /*--------------------------------------------------------------------------*/
 @Override
 public void setUserType(int type) {
   if (type == CURRENT_USER) {
     if (shortcut.getcurrentUserLinkPath().length() > 0) {
       shortcut.setUserType(ShellLink.CURRENT_USER);
     }
   } else if (type == ALL_USERS) {
     if (shortcut.getallUsersLinkPath().length() > 0) {
       shortcut.setUserType(ShellLink.ALL_USERS);
     }
   }
 }
コード例 #3
0
  /**
   * Returns <code>true</code> if the target OS supports current user and all users.
   *
   * @return <code>true</code> if the target OS supports current and all users.
   */
  public boolean multipleUsers() {
    boolean result = false;
    // Win NT4 won't have PROGRAMS for CURRENT_USER.
    // Win 98 may not have 'Start Menu\Programs' for ALL_USERS
    String allUsers = shortcut.getallUsersLinkPath();

    Debug.log(CLASS + myClass + ".multipleUsers()-1 '" + allUsers + "'");

    String currentUsers = shortcut.getcurrentUserLinkPath();
    Debug.log(CLASS + myClass + ".multipleUsers()-2 '" + currentUsers + "'");

    if (allUsers == null || currentUsers == null) result = false;
    else result = allUsers.length() > 0 && currentUsers.length() > 0;

    Debug.log(CLASS + myClass + ".multipleUsers()-3 '" + result + "'");
    return (result);
  }
コード例 #4
0
  /**
   * Returns <code>true</code> if the target OS supports current user and all users.
   *
   * @return <code>true</code> if the target OS supports current and all users.
   */
  @Override
  public boolean multipleUsers() {
    boolean result = false;
    // Win NT4 won't have PROGRAMS for CURRENT_USER.
    // Win 98 may not have 'Start Menu\Programs' for ALL_USERS
    String allUsers = shortcut.getallUsersLinkPath();

    String currentUsers = shortcut.getcurrentUserLinkPath();

    if (allUsers == null || currentUsers == null) {
      result = false;
    } else {
      result = allUsers.length() > 0 && currentUsers.length() > 0;
    }

    return result;
  }