oberhack    2004/03/02 04:26:20

  Modified:    
ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui
                        MerlinDeveloperUIResources.properties
               ide/org.apache.avalon.ide.eclipse.ui plugin.xml
               
ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/operation
                        AbstractGeneratorOperation.java
               
ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/preferences
                        MerlinMainPreferencePage.java
  Added:       
ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui/tools
                        ExampleBuilder.java AvalonProposals.java
                        JavadocProcessor.java
  Log:
  
  
  Revision  Changes    Path
  1.3       +15 -1     
avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui/MerlinDeveloperUIResources.properties
  
  Index: MerlinDeveloperUIResources.properties
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui/MerlinDeveloperUIResources.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MerlinDeveloperUIResources.properties     16 Feb 2004 21:00:03 -0000      1.2
  +++ MerlinDeveloperUIResources.properties     2 Mar 2004 12:26:20 -0000       1.3
  @@ -16,7 +16,7 @@
   #   See the License for the specific language governing permissions and
   #   limitations under the License. 
   #   
  -# */
  +# 
   #
   #########################################
   
  @@ -28,4 +28,18 @@
   new.MerlinDevelopment.selectionPage.description=Select a type of project you want 
to create.
   new.MerlinDevelopment.containerPage.title=Project Details
   new.MerlinDevelopment.containerPage.description=Enter required data to create your 
Merlin project
  +javadoc.avalon.component=mark a class as merlin component
  +javadoc.avalon.component.tag=avalon.component name="xx" version="1.0.0" 
livestyle="singleton"
  +javadoc.avalon.dependency=defines a dependency
  +javadoc.avalon.dependency.tag=avalon.dependency type="xx" key="yy"
  +javadoc.avalon.service.tag=avalon.service type="xx" version="1.0.0"
  +javadoc.avalon.service=defines the service interface
  +javadoc.avalon.entry.tag=avalon.entry entry="urn:avalon:xx"
  +javadoc.avalon.entry=defines an entry for special context values
  +javadoc.avalon.stage=define lifecycle extensions
  +javadoc.avalon.stage.tag=avalon.stage id="urn:name:type"
  +javadoc.avalon.extension=definition of an extension
  +javadoc.avalon.extension.tag=avalon.extension id="urn:name:type"
  +javadoc.avalon.logger.tag=avalon.logger name="xx.yy"
  +javadoc.avalon.logger=defines a logger
   
  
  
  
  1.6       +11 -4     avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/plugin.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- plugin.xml        16 Feb 2004 21:00:02 -0000      1.5
  +++ plugin.xml        2 Mar 2004 12:26:20 -0000       1.6
  @@ -24,9 +24,17 @@
         <import plugin="org.eclipse.jface.text"/>
         <import plugin="org.eclipse.ui.workbench.texteditor"/>
         <import plugin="org.eclipse.ui.editors"/>
  -     
  +      <import plugin="org.eclipse.jdt.ui"/>
      </requires>
   
  +   <extension
  +         point="org.eclipse.jdt.ui.javadocCompletionProcessor">
  +      <javadocCompletionProcessor
  +            name="Avalon Javadoc Processor"
  +            class="org.apache.avalon.ide.eclipse.merlin.ui.tools.JavadocProcessor"
  +            id="avalonJavadocProcessor">
  +      </javadocCompletionProcessor>
  +   </extension>
   
      <extension
            point="org.eclipse.ui.newWizards">
  @@ -50,13 +58,12 @@
               
id="org.apache.avalon.ide.eclipse.merlin.wizards.newMerlinNatureWizard2">
         </wizard>
      </extension>
  -   
      <extension
            point="org.eclipse.ui.editors">
         <editor
               name="Image Viewer"
  -            extensions="jpg, gif"
               icon="icons/sample.gif"
  +            extensions="jpg, gif"
               class="org.apache.avalon.ide.eclipse.merlin.ui.tools.ImageViewerEditor"
               id="Viewer.editors.XMLEditor">
         </editor>
  @@ -69,5 +76,5 @@
               id="org.apache.avalon.MerlinMainPreferencePage">
         </page>
      </extension>
  -      
  +
   </plugin>
  
  
  
  1.1                  
avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui/tools/ExampleBuilder.java
  
  Index: ExampleBuilder.java
  ===================================================================
  /*
   * One has to add the builder to a project first.
   * 
     IProjectDescription desc = project.getDescription();
     ICommand[] commands = desc.getBuildSpec();
     boolean found = false;
  
     for (int i = 0; i < commands.length; ++i) {
        if (commands[i].getBuilderName().equals(BUILDER_ID)) {
           found = true;
           break;
        }
     }
     if (!found) { 
        //add builder to project
        ICommand command = desc.newCommand();
        command.setBuilderName(BUILDER_ID);
        ICommand[] newCommands = new ICommand[commands.length + 1];
  
        // Add it before other builders.
        System.arraycopy(commands, 0, newCommands, 1, commands.length);
        newCommands[0] = command;
        desc.setBuildSpec(newCommands);
        project.setDescription(desc, null);
     }
  
  
   */
  package org.apache.avalon.ide.eclipse.merlin.ui.tools;
  
  import java.util.Map;
  
  import org.eclipse.core.resources.IProject;
  import org.eclipse.core.resources.IncrementalProjectBuilder;
  import org.eclipse.core.runtime.CoreException;
  import org.eclipse.core.runtime.IProgressMonitor;
  
  /**
   * @author Andreas Develop
   *
   * To change the template for this generated type comment go to
   * Window - Preferences - Java - Code Generation - Code and Comments
   */
  public class ExampleBuilder extends IncrementalProjectBuilder
  {
  
      /* (non-Javadoc)
       * @see org.eclipse.core.resources.IncrementalProjectBuilder#build(int, 
java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
       */
      protected IProject[] build(int pKind, Map pArgs, IProgressMonitor pMonitor) 
throws CoreException
      {
          Object obj = getDelta(getProject());
          System.out.println("here");
          // TODO Auto-generated method stub
          return null;
      }
  
      /**
       * 
       */
      public ExampleBuilder()
      {
          super();
          // TODO Auto-generated constructor stub
      }
  
  }
  
  
  
  1.1                  
avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui/tools/AvalonProposals.java
  
  Index: AvalonProposals.java
  ===================================================================
  /*
     
        Copyright 2004. The Apache Software Foundation.
  
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License. 
     
   */
  package org.apache.avalon.ide.eclipse.merlin.ui.tools;
  
  import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
  import org.eclipse.jface.text.BadLocationException;
  import org.eclipse.jface.text.IDocument;
  import org.eclipse.jface.text.contentassist.IContextInformation;
  import org.eclipse.swt.graphics.Image;
  import org.eclipse.swt.graphics.Point;
  
  /**
   * @author Andreas Develop
   *
   */
  public class AvalonProposals implements IJavaCompletionProposal
  {
      private int p_offset;
      private int p_length;
      private String key;
      private String proposal;
      private String tag;
      
      /**
       * 
       */
      public AvalonProposals()
      {
          super();
      }
      public AvalonProposals(int off, int len)
      {
          p_offset = off;
          p_length = len;
      }
      
      /* (non-Javadoc)
       * @see org.eclipse.jdt.ui.text.java.IJavaCompletionProposal#getRelevance()
       */
      public int getRelevance()
      {
          // TODO Auto-generated method stub
          return 0;
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
       */
      public void apply(IDocument pDocument)
      {
          try
          {
              pDocument.replace(p_offset, 0, tag);
          } catch (BadLocationException e)
          {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument)
       */
      public Point getSelection(IDocument pDocument)
      {
   
          return null;
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
       */
      public String getAdditionalProposalInfo()
      {
          return proposal;
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
       */
      public String getDisplayString()
      {
          
          return key;
      }
  
      /* (non-Javadoc)
       * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage()
       */
      public Image getImage()
      {
          // TODO Auto-generated method stub
          return null;
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation()
       */
      public IContextInformation getContextInformation()
      {
          // TODO Auto-generated method stub
          return null;
      }
      /**
       * @param pString
       */
      public void setKey(String pString)
      {
          key = pString;
      }
      /**
       * @param pString
       */
      public void setDescription(String pString)
      {
          proposal = pString;
      }
      /**
       * @param pString
       */
      public void setTag(String pString)
      {
          tag = pString;
      }
  
  }
  
  
  
  1.1                  
avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/ui/tools/JavadocProcessor.java
  
  Index: JavadocProcessor.java
  ===================================================================
  /*
     
        Copyright 2004. The Apache Software Foundation.
  
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License. 
     
   */
  package org.apache.avalon.ide.eclipse.merlin.ui.tools;
  
  import java.util.ArrayList;
  import java.util.Enumeration;
  import java.util.List;
  import java.util.ResourceBundle;
  
  import org.apache.avalon.ide.eclipse.merlin.ui.MerlinDeveloperUI;
  import org.eclipse.jdt.core.ICompilationUnit;
  import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
  import org.eclipse.jdt.ui.text.java.IJavadocCompletionProcessor;
  import org.eclipse.jface.text.contentassist.IContextInformation;
  
  /**
   * @author Andreas Develop
   *
   */
  public class JavadocProcessor implements IJavadocCompletionProcessor
  {
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jdt.ui.text.java.IJavadocCompletionProcessor#computeContextInformation(org.eclipse.jdt.core.ICompilationUnit,
 int)
       */
      public IContextInformation[] computeContextInformation(ICompilationUnit cUnit, 
int offset)
      {
          // 
          return null;
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jdt.ui.text.java.IJavadocCompletionProcessor#computeCompletionProposals(org.eclipse.jdt.core.ICompilationUnit,
 int, int, int)
       */
      public IJavaCompletionProposal[] computeCompletionProposals(
          ICompilationUnit cUnit,
          int offset,
          int length,
          int flags)
      {
          // TODO Auto-generated method stub
          List props = new ArrayList();
  
          ResourceBundle bundle = MerlinDeveloperUI.getDefault().getResourceBundle();
          Enumeration enum = bundle.getKeys();
          while (enum.hasMoreElements())
          {
              String key = (String) enum.nextElement();
              if (key.startsWith("javadoc.avalon") && (! key.endsWith(".tag")))
              {
                  AvalonProposals prop = new AvalonProposals(offset, length);
                  prop.setKey("@" + key.substring(8,key.length()));
                  prop.setDescription(MerlinDeveloperUI.getResourceString(key));
                  prop.setTag(MerlinDeveloperUI.getResourceString(key + ".tag"));
                  props.add(prop);
              }
          }
          return (IJavaCompletionProposal[]) props.toArray(new 
AvalonProposals[props.size()]);
      }
  
      /* (non-Javadoc)
       * @see 
org.eclipse.jdt.ui.text.java.IJavadocCompletionProcessor#getErrorMessage()
       */
      public String getErrorMessage()
      {
          // TODO Auto-generated method stub
          return null;
      }
      /**
       * 
       */
      public JavadocProcessor()
      {
          super();
          // TODO Auto-generated constructor stub
      }
  
  }
  
  
  
  1.3       +3 -1      
avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/operation/AbstractGeneratorOperation.java
  
  Index: AbstractGeneratorOperation.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/operation/AbstractGeneratorOperation.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractGeneratorOperation.java   16 Feb 2004 21:00:02 -0000      1.2
  +++ AbstractGeneratorOperation.java   2 Mar 2004 12:26:20 -0000       1.3
  @@ -64,11 +64,13 @@
           {
               
monitor.beginTask(MerlinDeveloperUI.getResourceString("NewWebAppProjectOperation.createWebAppTask.description"),
 1); //$NON-NLS-1$
   
  -            new ProjectResourceManager(
  +            ProjectResourceManager prm = new ProjectResourceManager(
                   projectModel,
                   pParam,
                   MerlinDeveloperUI.PLUGIN_ID,
                   MerlinDeveloperLaunch.MERLIN_PROJECT_NATURE_ID);
  +            
  +            prm.addBuilder(MerlinDeveloperLaunch.MERLIN_BUILDER_ID);
   
           } finally
           {
  
  
  
  1.2       +27 -69    
avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/preferences/MerlinMainPreferencePage.java
  
  Index: MerlinMainPreferencePage.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/ide/org.apache.avalon.ide.eclipse.ui/src/org/apache/avalon/ide/eclipse/merlin/preferences/MerlinMainPreferencePage.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MerlinMainPreferencePage.java     16 Feb 2004 21:00:03 -0000      1.1
  +++ MerlinMainPreferencePage.java     2 Mar 2004 12:26:20 -0000       1.2
  @@ -19,6 +19,7 @@
   package org.apache.avalon.ide.eclipse.merlin.preferences;
   
   
  +import 
org.apache.avalon.ide.eclipse.merlin.launch.container.MerlinContainerEnvironment;
   import org.apache.avalon.ide.eclipse.merlin.ui.MerlinDeveloperUI;
   import org.eclipse.jface.preference.IPreferenceStore;
   import org.eclipse.jface.preference.PreferencePage;
  @@ -39,6 +40,8 @@
        extends PreferencePage
        implements IWorkbenchPreferencePage {
   
  +    private MerlinContainerEnvironment env;
  +    
        public MerlinMainPreferencePage() {
                super();
                
setPreferenceStore(MerlinDeveloperUI.getDefault().getPreferenceStore());
  @@ -61,7 +64,7 @@
           area.setLayout(gridLayout_1);
           {
               final Group group = new Group(area, SWT.NONE);
  -            group.setText("Installation Properties");
  +            group.setText("Installation Directories");
               group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
               final GridLayout gridLayout = new GridLayout();
               gridLayout.numColumns = 3;
  @@ -69,80 +72,28 @@
               
               {
                   final Label label = new Label(group, SWT.NONE);
  -                label.setText("Merlin Insallation Directory:");
  +                label.setText("Avalon:");
               }
               {
                   final Text text = new Text(group, SWT.BORDER);
  -                text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  -            }
  -            {
  -                final Button button = new Button(group, SWT.NONE);
  -                button.setText("browse");
  -            }
  -            {
  -                final Label label = new Label(group, SWT.NONE);
  -                label.setText("Merlin Configuration Directory:");
  -            }
  -            {
  -                final Text text = new Text(group, SWT.BORDER);
  -                text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  -            }
  -            {
  -                final Button button = new Button(group, SWT.NONE);
  -                button.setText("browse");
  +                text.setEnabled(false);
  +                final GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
  +                gridData.horizontalSpan = 2;
  +                text.setLayoutData(gridData);
  +                text.setText(env.getAvalonHome());
               }
               {
                   final Label label = new Label(group, SWT.NONE);
  -                label.setText("Kernel Configuration File:");
  +                label.setText("Merlin:");
               }
               {
                   final Text text = new Text(group, SWT.BORDER);
  -                text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  -            }
  -            {
  -                final Button button = new Button(group, SWT.NONE);
  -                button.setText("browse");
  -            }
  -            {
  -                final Label label = new Label(group, SWT.NONE);
  -                label.setText("System Repository:");
  -            }
  -            {
  -                final Text text = new Text(group, SWT.BORDER);
  -                text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  -            }
  -            {
  -                final Button button = new Button(group, SWT.NONE);
  -                button.setText("browse");
  +                text.setEnabled(false);
  +                final GridData gridData = new 
GridData(GridData.HORIZONTAL_ALIGN_FILL);
  +                gridData.horizontalSpan = 2;
  +                text.setLayoutData(gridData);
  +                text.setText(env.getMerlinHome());
               }
  -            {
  -                final Label label = new Label(group, SWT.NONE);
  -                label.setText("Application Repository:");
  -            }
  -            {
  -                final Text text = new Text(group, SWT.BORDER);
  -                text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
  -            }
  -            {
  -                final Button button = new Button(group, SWT.NONE);
  -                button.setText("browse");
  -            }
  -        }
  -        {
  -             final Group group = new Group(area, SWT.NONE);
  -             group.setText("User Properties");
  -             group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  -             final GridLayout gridLayout = new GridLayout();
  -             gridLayout.numColumns = 3;
  -             group.setLayout(gridLayout);
  -        }
  -        {
  -             final Group group = new Group(area, SWT.NONE);
  -             group.setText("System Properties");
  -             group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  -             final GridLayout gridLayout = new GridLayout();
  -             gridLayout.numColumns = 3;
  -             group.setLayout(gridLayout);
           }
           {
               final Group group = new Group(area, SWT.NONE);
  @@ -158,14 +109,21 @@
                   final Button button = new Button(group, SWT.CHECK);
                   button.setText("Show Debug Informations");
               }
  -            {
  -                final Button button = new Button(group, SWT.CHECK);
  -                button.setText("Start Server as permanent Task");
  -            }
           }
           
           return null;
       }
        public void init(IWorkbench workbench) {
  +        
  +        env = new MerlinContainerEnvironment();
        }
  +    
  +    protected void performApply() {
  +        
  +    }
  +    protected void performDefaults() {
  +        env.setAvalonDefaultsHome();
  +        env.setMerlinDefaultsHome();
  +    }
  +    
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to