Package kameleon.plugin

Examples of kameleon.plugin.PlugInInfo


      /* Retrieve plug-in information object */
      ZipEntry infoFileEntry = plugInZip.getEntry(PLUGIN_INFO_FILE_NAME) ;
      if (infoFileEntry == null) {
        throw new InvalidPlugInException(plugin.getName()) ;
      }// if
      PlugInInfo info = (PlugInInfo) IOObject.readObjectFromFile(
          new BufferedInputStream(
              plugInZip.getInputStream(infoFileEntry))) ;

      // Close the zip file in order to copy it
      plugInZip.close() ;

      /* Determine the nature of the plug-in before adding it */
      if (info.isAnalyzer()) {
        addJar(plugin, info, this.analyzerFolder) ;
        addConfiguration(info, this.analyzerConfigFile) ;
        this.am.addAnalyzerInfo(info) ;
      } else {
        addJar(plugin, info, this.generatorFolder) ;
View Full Code Here


      ZipOutputStream newZip = new ZipOutputStream(new BufferedOutputStream(
          new FileOutputStream(targetZip))) ;
     
      // Add the plug-in in fo file
      newZip.putNextEntry(new ZipEntry(PLUGIN_INFO_FILE_NAME)) ;
      PlugInInfo info = BuildPlugIn.createPlugInInfo() ;
      IOObject.writeObjectToFile(tmpFile, info) ;
      InputStream src = new BufferedInputStream(new FileInputStream(tmpFile)) ;
      IOFile.copyFile(src, newZip) ;
      src.close() ;
     
View Full Code Here

      e.printStackTrace(System.err) ;
    }// try
  }// BuildPlugIn()
 
  private static PlugInInfo createPlugInInfo() {
    PlugInInfo info = new PlugInInfo(
        "WordML2003Analyzer"//$NON-NLS-1$
        true,
        "Word"//$NON-NLS-1$
        "aword.Main"//$NON-NLS-1$
        new String[]{"xml"}//$NON-NLS-1$
View Full Code Here

      }// if
      this.setCurrentFilePosition(insertIndex) ;
      try {
        if (this.am.getNAnalyzers(extension) > 0) {
          try {
            PlugInInfo analyzer =
                this.am.getAnalyzerInfo(extension) ;
            fi.setIdFormat(analyzer.getId()) ;
          } catch (NotUniquePlugInInfoException ex) {
            fi.setIdFormat(null) ;
          }// try
        }// if
      } catch (UnknownExtensionException ex) {
View Full Code Here

    PlugInMessage pmsg = new PlugInMessage(true, null) ;
    try {
      pmsg.setMessage(ADD_PLUG_IN_START_MESSAGE) ;
      this.addMessage(pmsg) ;

      PlugInInfo info = super.addPlugIn(plugin) ;

      pmsg.setState(PlugInMessage.State.SUCCESS) ;
      pmsg.setMessage(
          info.isAnalyzer() ? ADD_ANALYZER_SUCESS_MESSAGE
                        : ADD_GENERATOR_SUCESS_MESSAGE,
          info.getFormatName()) ;
     
      this.generatorAddedOrRemoved = !info.isAnalyzer() ;
      this.updateMessage(pmsg) ;
      this.generatorAddedOrRemoved = false ;

      return info ;
    } catch (KameleonException ke) {
View Full Code Here

      int rowIndex = 0 ;     
      String[] outputFiles = this.message.getTargetPath() ;
      String[] genIds = this.message.getTargetFormatId() ;
      boolean fileNotGenerated = false ;
      try {
        PlugInInfo analyzer = this.model.getAnalyzer(
            this.message.getIdFormat()) ;
        Document document = GenerationModel.launchAnalyzer(
            analyzer, this.message.getPath()) ;

        this.message.setState(GenerationState.GENERATING) ;
        this.model.updateMessage(this.message) ;
       
        for(rowIndex=0; rowIndex<genIds.length; ++rowIndex) {
          this.message.setState(rowIndex, State.CONVERTING) ;
          this.model.updateMessage(this.message) ;

          String genId = genIds[rowIndex] ;
          PlugInInfo generator = this.model.getGenerator(genId) ;
          try {
            GenerationModel.launchGenerator(
                generator, document, outputFiles[rowIndex]) ;

            this.message.setState(rowIndex, State.CONVERTED) ;
View Full Code Here

        int nGenerators = generators.size() ;
        List<String> selectedGenerators =
            GenerationView.this.model.getSelectedOutputFormats();
        for(int g=0; g < nGenerators; ++g) {
          try {
            PlugInInfo generatorInfo = generators.get(g) ;
            boolean selected =
                selectedGenerators.contains(generatorInfo.getId());
            String imagePath = String.format(selected ? COLOR_ICON : GRAY_ICON,
                generatorInfo.getId()) ;
           
            JButton button = new JButton(new ImageIcon(
                ImageUtility.getImageBytes(imagePath))) ;
            button.setContentAreaFilled(false) ;
            button.setBorderPainted(false) ;
            button.setCursor(
                Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)) ;
            button.setToolTipText(generatorInfo.getFormatName());
            button.addActionListener(new FormatSelectionListener(
                g,
                generatorInfo.getId(),
                button)) ;
            button.setSelected(selected);
           
            c = new GridBagConstraints() ;
            c.gridwidth = 1 ;
View Full Code Here

      ZipOutputStream newZip = new ZipOutputStream(new BufferedOutputStream(
          new FileOutputStream(targetZip))) ;
     
      // Add the plug-in in fo file
      newZip.putNextEntry(new ZipEntry(PLUGIN_INFO_FILE_NAME)) ;
      PlugInInfo info = BuildPlugIn.createPlugInInfo() ;
      IOObject.writeObjectToFile(tmpFile, info) ;
      InputStream src = new BufferedInputStream(new FileInputStream(tmpFile)) ;
      IOFile.copyFile(src, newZip) ;
      src.close() ;
     
View Full Code Here

      e.printStackTrace(System.err) ;
    }// try
  }// BuildPlugIn()
 
  private static PlugInInfo createPlugInInfo() {
    PlugInInfo info = new PlugInInfo(
        "DokuWikiAnalyzer"//$NON-NLS-1$
        true,
        "DokuWiki"//$NON-NLS-1$
        "adoku.Main"//$NON-NLS-1$
        new String[]{"txt"}//$NON-NLS-1$
View Full Code Here

      FileInfo lastG = gModel.getSelectedFileInfo() ;
      String[] formatIds = lastG.getTargetFormatId() ;
      String[] targetPaths = lastG.getTargetPath() ;
      int nGeneratedFiles = lastG.getTargetPath().length ;
      for(int file=0; file<nGeneratedFiles; file++) {
        PlugInInfo genInfo = gModel.getGenerator(formatIds[file]) ;
        String iconName = String.format(COLOR_ICON, genInfo.getId()) ;
        String formatName = genInfo.getFormatName() ;

        JLabel formatTitle = new JLabel(sl.getText(FORMAT)) ;
        JLabel pathTitle = new JLabel(sl.getText(PATH)) ;
        JLabel icon = new JLabel(
            new ImageIcon(ImageUtility.getImageBytes(iconName))) ;
View Full Code Here

TOP

Related Classes of kameleon.plugin.PlugInInfo

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.