Home | History | Annotate | Download | only in assetstudio
      1 /*
      2  * Copyright (C) 2011 The Android Open Source Project
      3  *
      4  * Licensed under the Eclipse Public License, Version 1.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.eclipse.org/org/documents/epl-v10.php
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package com.android.ide.eclipse.adt.internal.assetstudio;
     17 
     18 import org.eclipse.core.resources.IProject;
     19 import org.eclipse.core.resources.IResource;
     20 import org.eclipse.core.runtime.CoreException;
     21 import org.eclipse.jdt.ui.actions.AbstractOpenWizardAction;
     22 import org.eclipse.ui.INewWizard;
     23 
     24 import java.util.List;
     25 
     26 /** An action for opening the Create Icon Set wizard */
     27 public class OpenCreateAssetSetWizardAction extends AbstractOpenWizardAction {
     28     private IProject mProject;
     29     private CreateAssetSetWizard mWizard;
     30 
     31     /**
     32      * Creates a new {@link #OpenCreateAssetSetWizardAction} instance
     33      *
     34      * @param project the initial project to associate with the wizard
     35      */
     36     public OpenCreateAssetSetWizardAction(IProject project) {
     37         mProject = project;
     38     }
     39 
     40 
     41     @Override
     42     protected INewWizard createWizard() throws CoreException {
     43         mWizard = new CreateAssetSetWizard();
     44         mWizard.setProject(mProject);
     45         return mWizard;
     46     }
     47 
     48     /**
     49      * Returns the list of files created by the wizard. Must only be called
     50      * after this action's {@link #run()} method has been called. May return
     51      * null if the user cancels out of the wizard.
     52      *
     53      * @return a list of files created by the wizard, or null
     54      */
     55     public List<IResource> getCreatedFiles() {
     56         return mWizard.getCreatedFiles();
     57     }
     58 }
     59