Package org.netbeans.api.project

Examples of org.netbeans.api.project.Project


        return ProjectCustomizer.Category.create("ivy", NbBundle.getBundle(IvyCustomizerTab.class).getString("Customizer.Lbl"), null, new Category[0]);
    }

    @Override
    public JComponent createComponent(Category category, Lookup context) {
        Project project = context.lookup(Project.class);
        EditablePreferences projectPreferencesLookup = project.getLookup().lookup(EditablePreferences.class);
        IvyOptions optionsLookup = Lookup.getDefault().lookup(IvyOptions.class);
        IvyFacade ivyFacade = Lookup.getDefault().lookup(IvyFacade.class);
       
        CustomizerPanel panel = new CustomizerPanel(projectPreferencesLookup,optionsLookup,ivyFacade);
        category.setOkButtonListener(panel.getActionListener());
View Full Code Here


        if(null == srcDoc || null == targetIdentifier){
            return null;
        }
       
        FileObject fo = NbEditorUtilities.getFileObject(srcDoc);
        Project project = FileOwnerQuery.getOwner(fo);
       
       
        String classRelativePath = targetIdentifier.replaceAll("\\.", "/");
        FileObject classFO = null;
       
View Full Code Here

     * various properties for them influencing wizard appearance.
     */
    private WizardDescriptor.Panel[] getPanels() {
        if (panels == null) {
       
            Project project = Templates.getProject(wizard);
            Sources s = ProjectUtils.getSources(project);
            SourceGroup[] groups = s.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
            WizardDescriptor.Panel targetChooser =
                    0 == groups.length ?
                    Templates.createSimpleTargetChooser(
View Full Code Here

        public void run() throws IOException {
            // MODIFY WEB.XML
            FileObject dd = webModule.getDeploymentDescriptor();
            WebApp webApp = DDProvider.getDefault().getDDRoot(dd);
            Project project = FileOwnerQuery.getOwner(dd);


            addServlet(webApp, DISPATCHER_SERVLET_NAME,
                    DISPATCHER_SERVLET_CLASS, frameworkPanel.getDispatcherUrl(), "1");
           
View Full Code Here

        private void addLibraryToWebModule(WebModule wm, String libraryName) {
            FileObject docroot = wm.getDocumentBase();
            FileObject srcRootFO = null;

            Project project = FileOwnerQuery.getOwner(docroot);
            SourceGroup[] sgs = StripesPaletteUtilities.getSourceGroups(project,
                    JavaProjectConstants.SOURCES_TYPE_JAVA);
            if(0 != sgs.length){
                srcRootFO = sgs[0].getRootFolder();
            }
View Full Code Here

     * Initialize panels representing individual wizard's steps and sets
     * various properties for them influencing wizard appearance.
     */
    private WizardDescriptor.Panel[] getPanels() {
        if (panels == null) {
            Project p = Templates.getProject(wizard);
            Sources s = ProjectUtils.getSources(p);
            SourceGroup[] groups = s.getSourceGroups(Sources.TYPE_GENERIC);
            WizardDescriptor.Panel customizedTargetChooser =
                    Templates.createSimpleTargetChooser(p, groups,
                        new LayoutDefinitionWizardPanel(wizard));
View Full Code Here

     *
     * @param fObj
     * @return
     */
    public static SourceGroup[] getSourceGroups(FileObject fObj, String sourceType) {
        Project project = FileOwnerQuery.getOwner(fObj);
       
        return getSourceGroups(project, sourceType);
    }
View Full Code Here

    }
   
    private static class Renderer extends DefaultListCellRenderer {
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            File f = (File) value;
            Project p = FileOwnerQuery.getOwner(f.toURI());
            String message = f.getAbsolutePath();           
            Component result = super.getListCellRendererComponent(list, message, index, isSelected, cellHasFocus);
            return result;
        }
View Full Code Here

        }
    }//GEN-LAST:event_addButtonActionPerformed
   
   
    static boolean isValidRoot (File file, File[] relatedRoots, File projectFolder) {
        Project p;
        if ((p = FileOwnerQuery.getOwner(file.toURI()))!=null
            && !file.getAbsolutePath().startsWith(projectFolder.getAbsolutePath()+File.separatorChar)) {
            final Sources sources = (Sources) p.getLookup().lookup(Sources.class);
            if (sources == null) {
                return false;
            }
            final SourceGroup[] sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);
            final SourceGroup[] javaGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
            final SourceGroup[] groups = new SourceGroup [sourceGroups.length + javaGroups.length];
            System.arraycopy(sourceGroups,0,groups,0,sourceGroups.length);
            System.arraycopy(javaGroups,0,groups,sourceGroups.length,javaGroups.length);
            final FileObject projectDirectory = p.getProjectDirectory();
            final FileObject fileObject = FileUtil.toFileObject(file);
            if (projectDirectory == null || fileObject == null) {
                return false;
            }
            for (int i = 0; i< groups.length; i++) {
View Full Code Here

        assert false : "Fake action should never really be called";
    }

    public boolean enable (Project p) {
        if (mainProject != p) {
            Project o = mainProject;
            mainProject = p;
            pcs.firePropertyChange ("mainProject", o, mainProject);
        }
        return true; // unused
    }
View Full Code Here

TOP

Related Classes of org.netbeans.api.project.Project

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.