Examples of ILazyApplicationInfo


Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

   */
  public ILazyApplicationInfo[] getLocalApplications(IOfficeProgressMonitor officeProgressMonitor) {
    ArrayList arrayList = new ArrayList();
    if (System.getProperty("oo.application.path") != null) {
      String path = new File(System.getProperty("oo.application.path")).getAbsolutePath();
      ILazyApplicationInfo applicationInfo = findLocalApplicationInfo(path);
      if (applicationInfo != null)
        arrayList.add(applicationInfo);
    }
    else if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1) { //$NON-NLS-1$ //$NON-NLS-2$
      try {
        String[] possibleKeys = getPossibleKeys();
        if (officeProgressMonitor != null)
          officeProgressMonitor.beginTask(Messages.getString("ApplicationAssistant.monitor_message_scannig_registry"), possibleKeys.length); //$NON-NLS-1$
        RegistryKey[] ROOTS = new RegistryKey[] { Registry.HKEY_CLASSES_ROOT,
            Registry.HKEY_CURRENT_USER, Registry.HKEY_LOCAL_MACHINE };
        for (int i = 0, n = possibleKeys.length; i < n; i++) {
          if (officeProgressMonitor != null)
            officeProgressMonitor.beginSubTask(Messages.getString("ApplicationAssistant.monitor_scanning_key", possibleKeys[i])); //$NON-NLS-1$
          for (int j = 0; j < ROOTS.length; j++) {
            RegistryKey registryKey = Registry.openSubkey(ROOTS[j],
                possibleKeys[i],
                RegistryKey.ACCESS_READ);
            if (registryKey != null) {
              String path = null;
              if (path == null) {
                try {
                  path = registryKey.getStringValue("Path");
                  path = "\"" + path
                      + "\"";
                }
                catch (NoSuchValueException noSuchValueException) {
                  //ignore
                }
              }
              if (path == null) {
                try {
                  path = registryKey.getDefaultValue();
                }
                catch (NoSuchValueException noSuchValueException) {
                  //ignore
                }
              }
              if (path != null) {
                int position = path.indexOf(APPLICATION_EXECUTEABLE);
                if (position != -1) {
                  path = path.substring(1, position - 9);
                  ILazyApplicationInfo applicationInfo = findLocalApplicationInfo(path);
                  if (applicationInfo != null) {
                    boolean found = false;
                    for (Iterator iterator = arrayList.iterator(); iterator.hasNext();) {
                      ILazyApplicationInfo tmpApplicationInfo = (ILazyApplicationInfo) iterator.next();
                      if (tmpApplicationInfo.getHome().equalsIgnoreCase(applicationInfo.getHome())) {
                        found = true;
                        break;
                      }
                    }
                    if (!found)
                      arrayList.add(applicationInfo);
                  }
                }
              }
            }
          }
          if (officeProgressMonitor != null)
            if (officeProgressMonitor.isCanceled())
              break;
        }
      }
      catch (Throwable throwable) {
        return ILazyApplicationInfo.EMPTY_LAZY_APPLICATION_INFOS_ARRAY;
      }
    }
    else {
      try {
        if (officeProgressMonitor != null)
          officeProgressMonitor.beginTask(Messages.getString("ApplicationAssistant.monitor_looking_for_office_application"), IOfficeProgressMonitor.WORK_UNKNOWN); //$NON-NLS-1$
        ArrayList possibleOfficeHomes = new ArrayList();
        File file = new File("/opt"); //$NON-NLS-1$
        findPossibleOfficeHomes(officeProgressMonitor, file, possibleOfficeHomes);
        file = new File("/usr"); //$NON-NLS-1$
        findPossibleOfficeHomes(officeProgressMonitor, file, possibleOfficeHomes);
        if (officeProgressMonitor != null)
          officeProgressMonitor.beginSubTask(Messages.getString("ApplicationAssistant.monitor_buildung_application_infos")); //$NON-NLS-1$
        String[] officeHomes = (String[]) possibleOfficeHomes.toArray(new String[possibleOfficeHomes.size()]);
        for (int i = 0, n = officeHomes.length; i < n; i++) {
          ILazyApplicationInfo applicationInfo = findLocalApplicationInfo(officeHomes[i]);
          if (applicationInfo != null)
            arrayList.add(applicationInfo);
        }
      }
      catch (Throwable throwable) {
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

      IOfficeProgressMonitor officeProgressMonitor) {
    ArrayList arrayList = new ArrayList();
    if (System.getProperty("oo.application.path") != null) {
      String path = new File(System.getProperty("oo.application.path"))
          .getAbsolutePath();
      ILazyApplicationInfo applicationInfo = findLocalApplicationInfo(path);
      if (applicationInfo != null)
        arrayList.add(applicationInfo);
    } else if (System
        .getProperty("os.name").toLowerCase().indexOf("windows") != -1) { //$NON-NLS-1$ //$NON-NLS-2$
      try {
        String[] possibleKeys = getPossibleKeys();
        if (officeProgressMonitor != null)
          officeProgressMonitor
              .beginTask(
                  Messages
                      .getString("ApplicationAssistant.monitor_message_scannig_registry"), possibleKeys.length); //$NON-NLS-1$
        RegistryKey[] ROOTS = new RegistryKey[] {
            Registry.HKEY_CLASSES_ROOT, Registry.HKEY_CURRENT_USER,
            Registry.HKEY_LOCAL_MACHINE };
        for (int i = 0, n = possibleKeys.length; i < n; i++) {
          if (officeProgressMonitor != null)
            officeProgressMonitor
                .beginSubTask(Messages
                    .getString(
                        "ApplicationAssistant.monitor_scanning_key", possibleKeys[i])); //$NON-NLS-1$
          for (int j = 0; j < ROOTS.length; j++) {
            RegistryKey registryKey = Registry.openSubkey(ROOTS[j],
                possibleKeys[i], RegistryKey.ACCESS_READ);
            if (registryKey != null) {
              String path = null;
              if (path == null) {
                try {
                  path = registryKey.getStringValue("Path");
                  path = "\"" + path + "\"";
                } catch (NoSuchValueException noSuchValueException) {
                  // ignore
                }
              }
              if (path == null) {
                try {
                  path = registryKey.getDefaultValue();
                } catch (NoSuchValueException noSuchValueException) {
                  // ignore
                }
              }
              if (path != null) {
                int position = path
                    .indexOf(APPLICATION_EXECUTEABLE);
                if (position != -1) {
                  path = path.substring(1, position - 9);
                  ILazyApplicationInfo applicationInfo = findLocalApplicationInfo(path);
                  if (applicationInfo != null) {
                    boolean found = false;
                    for (Iterator iterator = arrayList
                        .iterator(); iterator.hasNext();) {
                      ILazyApplicationInfo tmpApplicationInfo = (ILazyApplicationInfo) iterator
                          .next();
                      if (tmpApplicationInfo.getHome()
                          .equalsIgnoreCase(
                              applicationInfo
                                  .getHome())) {
                        found = true;
                        break;
                      }
                    }
                    if (!found)
                      arrayList.add(applicationInfo);
                  }
                }
              }
            }
          }
          if (officeProgressMonitor != null)
            if (officeProgressMonitor.isCanceled())
              break;
        }
      } catch (Throwable throwable) {
        return ILazyApplicationInfo.EMPTY_LAZY_APPLICATION_INFOS_ARRAY;
      }
    } else {
      try {
        if (officeProgressMonitor != null)
          officeProgressMonitor
              .beginTask(
                  Messages
                      .getString("ApplicationAssistant.monitor_looking_for_office_application"), IOfficeProgressMonitor.WORK_UNKNOWN); //$NON-NLS-1$
        ArrayList possibleOfficeHomes = new ArrayList();
        File file = new File("/opt"); //$NON-NLS-1$
        findPossibleOfficeHomes(officeProgressMonitor, file,
            possibleOfficeHomes);
        file = new File("/usr"); //$NON-NLS-1$
        findPossibleOfficeHomes(officeProgressMonitor, file,
            possibleOfficeHomes);
        if (officeProgressMonitor != null)
          officeProgressMonitor
              .beginSubTask(Messages
                  .getString("ApplicationAssistant.monitor_buildung_application_infos")); //$NON-NLS-1$
        String[] officeHomes = (String[]) possibleOfficeHomes
            .toArray(new String[possibleOfficeHomes.size()]);
        for (int i = 0, n = officeHomes.length; i < n; i++) {
          ILazyApplicationInfo applicationInfo = findLocalApplicationInfo(officeHomes[i]);
          if (applicationInfo != null)
            arrayList.add(applicationInfo);
        }
      } catch (Throwable throwable) {
        return ILazyApplicationInfo.EMPTY_LAZY_APPLICATION_INFOS_ARRAY;
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

      for (int i = 0, n = tableItems.length; i < n; i++) {
        tableItems[i].dispose();
      }

      IApplicationAssistant applicationAssistant = OfficeApplicationRuntime.getApplicationAssistant(EditorCorePlugin.getDefault().getLibrariesLocation());
      ILazyApplicationInfo applicationInfo = applicationAssistant.findLocalApplicationInfo(textHome.getText());
      if (applicationInfo != null) {
        IApplicationProperties applicationProperties = applicationInfo.getProperties();
        if (applicationProperties != null) {
          String[] names = applicationProperties.getPropertyNames();
          TreeSet treeSet = new TreeSet(Arrays.asList(names));
          names = (String[]) treeSet.toArray(new String[treeSet.size()]);
          for (int i = 0, n = names.length; i < n; i++) {
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

    textHome.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    textHome.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent modifyEvent) {
        checkPageState();
        selectedHomePath = textHome.getText();
        ILazyApplicationInfo applicationInfo = selectApplicationInfo(textHome.getText());
        textHome.setFocus();
        if (applicationInfo == null) {
          try {
            IApplicationAssistant applicationAssistant = OfficeApplicationRuntime.getApplicationAssistant(EditorCorePlugin.getDefault().getLibrariesLocation());
            applicationInfo = applicationAssistant.findLocalApplicationInfo(textHome.getText());
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

    tableApplicationInfos.setHeaderVisible(true);

    tableApplicationInfos.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent selectionEvent) {
        TableItem tableItem = (TableItem) selectionEvent.item;
        ILazyApplicationInfo applicationInfo = (ILazyApplicationInfo) tableItem.getData();
        if (applicationInfo != null) {
          if (!applicationInfo.getHome().equals(textHome.getText())) {
            textHome.setText(applicationInfo.getHome());
            textHome.setSelection(applicationInfo.getHome().length());
          }
        }
      }
    });
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

    if (home.length() != 0) {
      File file = new File(home);
      if (file.canRead()) {
        try {
          IApplicationAssistant applicationAssistant = OfficeApplicationRuntime.getApplicationAssistant(EditorCorePlugin.getDefault().getLibrariesLocation());
          ILazyApplicationInfo applicationInfo = applicationAssistant.findLocalApplicationInfo(home);
          if (applicationInfo == null) {
            setPageComplete(true);
            setMessage(Messages.LocalApplicationWizardDefinePage_message_warning_path_invalid,
                IMessageProvider.WARNING);
          }
          else {
            if (applicationInfo.getMajorVersion() == 1 && applicationInfo.getMinorVersion() == 9) {
              setPageComplete(true);
              setMessage(Messages.LocalApplicationWizardDefinePage_message_warning_beta_release,
                  IMessageProvider.WARNING);
            }
            else if (applicationInfo.getMajorVersion() == 1) {
              setPageComplete(true);
              setMessage(Messages.LocalApplicationWizardDefinePage_message_warning_version_old,
                  IMessageProvider.WARNING);
            }
            else {
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

  private void fillTable(Table table) {
    if (applicationInfos == null || table == null)
      return;

    for (int i = 0, n = applicationInfos.length; i < n; i++) {
      ILazyApplicationInfo applicationInfo = applicationInfos[i];
      addApplicationInfo(table, applicationInfo);
    }
  }
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

    if (tableApplicationInfos != null) {
      TableItem[] tableItems = tableApplicationInfos.getItems();
      for (int i = 0, n = tableItems.length; i < n; i++) {
        TableItem tableItem = tableItems[i];
        ILazyApplicationInfo applicationInfo = (ILazyApplicationInfo) tableItem.getData();
        if (applicationInfo != null) {
          if (applicationInfo.getHome().equals(home)) {
            tableApplicationInfos.select(i);
            return applicationInfo;
          }
        }
      }
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

    if (tableApplicationInfos != null) {
      TableItem[] tableItems = tableApplicationInfos.getItems();
      for (int i = 0, n = tableItems.length; i < n; i++) {
        TableItem tableItem = tableItems[i];
        ILazyApplicationInfo applicationInfo = (ILazyApplicationInfo) tableItem.getData();
        if (applicationInfo != null) {
          if (applicationInfo.getHome().equals(home)) {
            return applicationInfo;
          }
        }
      }
    }
View Full Code Here

Examples of ag.ion.bion.officelayer.application.ILazyApplicationInfo

    if (applicationInfos == null)
      return;

    String home = null;
    for (int i = 0, n = applicationInfos.length; i < n; i++) {
      ILazyApplicationInfo applicationInfo = applicationInfos[i];
      if (applicationInfo.getMajorVersion() == 2) {
        home = applicationInfo.getHome();
        break;
      }
      else if (applicationInfo.getMajorVersion() == 1 && applicationInfo.getMinorVersion() == 9)
        home = applicationInfo.getHome();
    }
    if (home != null) {
      textHome.setText(home);
      textHome.setSelection(home.length());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.