View | Details | Raw Unified | Return to bug 218240
Collapse All | Expand All

(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarActionProvider.java (-2 / +18 lines)
 Lines 45-50    Link Here 
45
package org.netbeans.modules.j2ee.ejbjarproject;
45
package org.netbeans.modules.j2ee.ejbjarproject;
46
46
47
import java.util.*;
47
import java.util.*;
48
import org.netbeans.api.annotations.common.NonNull;
48
import org.netbeans.api.debugger.DebuggerManager;
49
import org.netbeans.api.debugger.DebuggerManager;
49
import org.netbeans.api.debugger.Session;
50
import org.netbeans.api.debugger.Session;
50
import org.netbeans.api.debugger.jpda.AttachingDICookie;
51
import org.netbeans.api.debugger.jpda.AttachingDICookie;
 Lines 64-69    Link Here 
64
import org.netbeans.spi.java.classpath.ClassPathFactory;
65
import org.netbeans.spi.java.classpath.ClassPathFactory;
65
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
66
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
66
import org.netbeans.spi.java.project.classpath.support.ProjectClassPathSupport;
67
import org.netbeans.spi.java.project.classpath.support.ProjectClassPathSupport;
68
import org.netbeans.spi.project.ActionProvider;
69
import org.netbeans.spi.project.LookupProvider;
70
import org.netbeans.spi.project.ProjectServiceProvider;
67
import org.netbeans.spi.project.SingleMethod;
71
import org.netbeans.spi.project.SingleMethod;
68
import org.openide.DialogDisplayer;
72
import org.openide.DialogDisplayer;
69
import org.openide.NotifyDescriptor;
73
import org.openide.NotifyDescriptor;
 Lines 71-82    Link Here 
71
import org.openide.filesystems.FileUtil;
75
import org.openide.filesystems.FileUtil;
72
import org.openide.util.Lookup;
76
import org.openide.util.Lookup;
73
import org.openide.util.NbBundle;
77
import org.openide.util.NbBundle;
78
import org.openide.util.Parameters;
74
79
75
80
76
/** Action provider of the Web project. This is the place where to do
81
/** Action provider of the Web project. This is the place where to do
77
 * strange things to Web actions. E.g. compile-single.
82
 * strange things to Web actions. E.g. compile-single.
78
 */
83
 */
79
class EjbJarActionProvider extends BaseActionProvider {
84
public class EjbJarActionProvider extends BaseActionProvider {
80
85
81
    private static final String DIRECTORY_DEPLOYMENT_SUPPORTED = "directory.deployment.supported"; // NOI18N
86
    private static final String DIRECTORY_DEPLOYMENT_SUPPORTED = "directory.deployment.supported"; // NOI18N
82
87
 Lines 143-149    Link Here 
143
    
148
    
144
    /** Map from commands to ant targets */
149
    /** Map from commands to ant targets */
145
    private Map<String,String[]> commands;
150
    private Map<String,String[]> commands;
146
    
151
147
    public EjbJarActionProvider(EjbJarProject project, UpdateHelper updateHelper) {
152
    public EjbJarActionProvider(EjbJarProject project, UpdateHelper updateHelper) {
148
        super(project, updateHelper, project.evaluator(), project.getSourceRoots(), project.getTestSourceRoots(), 
153
        super(project, updateHelper, project.evaluator(), project.getSourceRoots(), project.getTestSourceRoots(), 
149
                project.getAntProjectHelper(), new CallbackImpl(new BaseActionProvider.CallbackImpl(project.getClassPathProvider()), project.getEjbModule()));
154
                project.getAntProjectHelper(), new CallbackImpl(new BaseActionProvider.CallbackImpl(project.getClassPathProvider()), project.getEjbModule()));
 Lines 395-398    Link Here 
395
        }
400
        }
396
    }
401
    }
397
402
403
    @ProjectServiceProvider(
404
            service = ActionProvider.class,
405
            projectTypes = {@LookupProvider.Registration.ProjectType(id = "org-netbeans-modules-j2ee-ejbjarproject", position=1)})
406
    public static EjbJarActionProvider create(@NonNull final Lookup lkp) {
407
            Parameters.notNull("lkp", lkp); //NOI18N
408
        final EjbJarProject project = lkp.lookup(EjbJarProject.class);
409
        final EjbJarActionProvider ejbActionProvider = new EjbJarActionProvider(project, project.getUpdateHelper());
410
        ejbActionProvider.startFSListener();
411
        return ejbActionProvider;
412
    }
413
398
}
414
}
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProject.java (-1 lines)
 Lines 429-435    Link Here 
429
                // FIXME this is just fallback for code searching for the old SPI in lookup
429
                // FIXME this is just fallback for code searching for the old SPI in lookup
430
                // remove in next release
430
                // remove in next release
431
                new EjbJarImpl(apiEjbJar),
431
                new EjbJarImpl(apiEjbJar),
432
                new EjbJarActionProvider(this, updateHelper),
433
                new EjbJarLogicalViewProvider(this, updateHelper, evaluator(), spp, refHelper, ejbModule),
432
                new EjbJarLogicalViewProvider(this, updateHelper, evaluator(), spp, refHelper, ejbModule),
434
                new CustomizerProviderImpl( this, updateHelper, evaluator(), refHelper ),
433
                new CustomizerProviderImpl( this, updateHelper, evaluator(), refHelper ),
435
                LookupMergerSupport.createClassPathProviderMerger(cpProvider),
434
                LookupMergerSupport.createClassPathProviderMerger(cpProvider),
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProjectOperations.java (-12 / +15 lines)
 Lines 47-54    Link Here 
47
import java.io.File;
47
import java.io.File;
48
import java.io.IOException;
48
import java.io.IOException;
49
import java.util.ArrayList;
49
import java.util.ArrayList;
50
import java.util.Arrays;
51
import java.util.Collection;
52
import java.util.Collections;
53
import java.util.HashSet;
50
import java.util.List;
54
import java.util.List;
51
import java.util.Properties;
55
import java.util.Properties;
56
import java.util.Set;
52
import org.apache.tools.ant.module.api.support.ActionUtils;
57
import org.apache.tools.ant.module.api.support.ActionUtils;
53
import org.netbeans.api.project.FileOwnerQuery;
58
import org.netbeans.api.project.FileOwnerQuery;
54
import org.netbeans.api.project.Project;
59
import org.netbeans.api.project.Project;
 Lines 163-182    Link Here 
163
        return files;
168
        return files;
164
    }
169
    }
165
    
170
    
171
    @Override
166
    public void notifyDeleting() throws IOException {
172
    public void notifyDeleting() throws IOException {
167
        EjbJarActionProvider ap = project.getLookup().lookup(EjbJarActionProvider.class);
173
        ActionProvider ap = project.getLookup().lookup(ActionProvider.class);
168
        
169
        assert ap != null;
174
        assert ap != null;
170
        
175
171
        Lookup context = Lookups.fixed(new Object[0]);
176
        Set<String> targets = new HashSet<String>(Arrays.asList(ap.getSupportedActions()));
172
        Properties p = new Properties();
177
        if (targets.contains(ActionProvider.COMMAND_CLEAN)) {
173
        String[] targetNames = ap.getTargetNames(ActionProvider.COMMAND_CLEAN, context, p);
178
            FileObject buildXML = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
174
        FileObject buildXML = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
179
            ActionUtils.runTarget(buildXML, new String[]{ActionProvider.COMMAND_CLEAN}, new Properties()).waitFinished();
175
        
180
            return;
176
        assert targetNames != null;
181
        }
177
        assert targetNames.length > 0;
182
        assert false; // the EjbJarActionProvider must have clean action to run
178
        
179
        ActionUtils.runTarget(buildXML, targetNames, p).waitFinished();
180
    }
183
    }
181
    
184
    
182
    public void notifyDeleted() throws IOException {
185
    public void notifyDeleted() throws IOException {

Return to bug 218240
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo