Logo Search packages:      
Sourcecode: aspectj version File versions

BrowserOutputLocationManager.java

/********************************************************************
 * Copyright (c) 2007 Contributors. All rights reserved. 
 * This program and the accompanying materials are made available 
 * under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution and is available at 
 * http://eclipse.org/legal/epl-v10.html 
 *  
 * Contributors: IBM Corporation - initial API and implementation 
 *                       Helen Hawkins   - initial version (bug 148190)
 *******************************************************************/
package org.aspectj.tools.ajbrowser.core;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.aspectj.ajde.core.IOutputLocationManager;
import org.aspectj.ajde.ui.UserPreferencesAdapter;

/**
 * IOutputLocationManager which returns the same output location for all files and resources.
 */
00025 public class BrowserOutputLocationManager implements IOutputLocationManager {

      private UserPreferencesAdapter preferencesAdapter;

      public BrowserOutputLocationManager(UserPreferencesAdapter preferencesAdapter) {
            this.preferencesAdapter = preferencesAdapter;
      }

00033       public File getOutputLocationForClass(File compilationUnit) {
            return new File(getCommonOutputDir());
      }

00037       public File getOutputLocationForResource(File resource) {
            return new File(getCommonOutputDir());
      }

      private String getCommonOutputDir() {
            String outputPath = preferencesAdapter.getProjectPreference(PreferenceStoreConstants.BUILD_OUTPUTPATH);
            if (outputPath == null) {
                  return ".";
            }
            return outputPath;
      }

00049       public List getAllOutputLocations() {
            List outputDirs = new ArrayList();
            outputDirs.add(new File(getCommonOutputDir()));
            return outputDirs;
      }

00055       public File getDefaultOutputLocation() {
            return new File(getCommonOutputDir());
      }

00059       public String getSourceFolderForFile(File sourceFile) {
            return null;
      }

00063       public void reportFileWrite(String outputfile, int filetype) {
      }

00066       public void reportFileRemove(String outputfile, int filetype) {
      }

      public int discoverChangesSince(File dir, long buildtime) {
            // TODO Auto-generated method stub
            return 0;
      }

00074       public Map getInpathMap() {
            return Collections.EMPTY_MAP;
      }

}

Generated by  Doxygen 1.6.0   Back to index