Package org.openbp.core.model

Examples of org.openbp.core.model.Association


    {
      String path = Application.getRootDir() + StringUtil.FOLDER_SEP + "doc" + StringUtil.FOLDER_SEP + name;

      boolean pdf = path.endsWith(".pdf");

      Association as = new Association();
      if (pdf)
      {
        as.setAssociationTypes(new String[]
        {
          MimeTypes.APPLICATION_PDF
        });
      }
      else
      {
        as.setAssociationTypes(new String[]
        {
          MimeTypes.HTML_FILE, MimeTypes.URL
        });
      }
      as.setAssociationPriority(Association.PRIMARY);
      as.setAssociatedObject(path);
      boolean consumed = JaspiraEventMgr.fireGlobalEvent("plugin.association.tryopen", as);

      if (! consumed)
      {
        String msg = getPluginResourceCollection().getRequiredString(
View Full Code Here


        if (fileToOpen == null)
          return;

        String mimeType = resultList.getMimeType(fileToOpen);

        Association as = new Association();
        as.setAssociationTypes(new String [] { mimeType, MimeTypes.TEXT_FILE });
        as.setAssociationPriority(Association.PRIMARY);

        as.setAssociatedObject(new File(fileToOpen).getAbsolutePath());

        JaspiraEventMgr.fireGlobalEvent("plugin.association.open", as);
      }
    }
  }
View Full Code Here

              if (associations != null)
              {
                int n = associations.size();
                for (int i = 0; i < n; ++i)
                {
                  Association assoc = (Association) associations.get(i);
                  if (assoc.getAssociationPriority() == priority)
                  {
                    mimeTypes = assoc.getAssociationTypes();
                    break;
                  }
                }
              }
            }
View Full Code Here

            if (associations != null)
            {
              int n = associations.size();
              for (int i = 0; i < n; ++i)
              {
                Association assoc = (Association) associations.get(i);
                if (assoc.getAssociationPriority() == priority)
                {
                 
                  JaspiraEventHandlerCode ret = doOpen(assoc, !mo.isModifiable(), event);
                  if (ret != EventModule.EVENT_IGNORED)
                    return ret;
                }
              }
            }
            else
            {
              // No associations defined for this model object;
              // Assume this is ok and prevent an error message
              // TODONOW return EVENT_CONSUMED;
            }
          }
        }
      }
      else if (o instanceof Association)
      {
        Association assoc = (Association) o;
        if (assoc.getAssociationPriority() == Association.PRIMARY)
        {
          JaspiraEventHandlerCode ret = doOpen(assoc, false, event);
          if (ret != EventModule.EVENT_IGNORED)
            return ret;
        }
View Full Code Here

        JaspiraAction group = new JaspiraAction(AssociationPlugin.this, "submenu.open");

        int n = associations.size();
        for (int iAssoc = 0; iAssoc < n; ++iAssoc)
        {
          Association association = (Association) associations.get(iAssoc);

          String hintMsg = null;
          OpenEventInfo [] openEventInfo = null;

          if (association.getAssociatedObject() == null)
          {
            // Association present, but no associated object.
            // The association contains a hint message, e. g. "Object has not yet been generated"
            hintMsg = association.getHintMsg();
          }
          else
          {
            // Check the mime types supported by this object
            String [] types = association.getAssociationTypes();
            if (types == null || types.length == 0)
            {
              hintMsg = getPluginResourceCollection().getRequiredString("messages.hints.noassociation");
            }
            else
View Full Code Here

TOP

Related Classes of org.openbp.core.model.Association

Copyright © 2018 www.massapicom. 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.