Package org.netbeans.api.project

Examples of org.netbeans.api.project.Project


            }
        }
    }

    private void updatePackageCombo() {
        Project p = (Project) projectCombo.getSelectedItem();
        if (p == null) {
            throw new IllegalStateException("Project cannot be null.");
        }
        Collection<JavaPackage> packages = ProjectUtils.getSourcePackages(p, true);
        JavaPackageComboBoxModel model = new JavaPackageComboBoxModel();
View Full Code Here


            return this;
        }
        if (!Project.class.isAssignableFrom(value.getClass())) {
            throw new IllegalArgumentException("This is a renderer to Project elements only!");
        }
        Project project = (Project) value;
        setText(ProjectUtils.getInformation(project).getDisplayName());
        setIcon(ProjectUtils.getInformation(project).getIcon());
        return this;
    }
View Full Code Here

        return getSelectedProject(Utilities.actionsGlobalContext());
    }

    public static Project getSelectedProject(final Lookup context) {
        Lookup.Result<Project> projectLookup = context.lookupResult(Project.class);
        Project p = (projectLookup.allInstances().isEmpty()) ? null : projectLookup.allInstances().iterator().next();
        if (p == null) {
            DataObject packageNode = PackageUtils.getSelectedPackage(context);
            if (packageNode != null) {
                p = FileOwnerQuery.getOwner(packageNode.getPrimaryFile());
            }
View Full Code Here

        }
    }
   

    public File getFile(Project parentProject) throws MvnModelInputException {
        Project projectOwner = getProjectOwner(parentProject);
        if(projectOwner == null) {
            throw new ProjectNotFoundException(getShortProjectKey());
        }
        File file;
        String path = getPath();
        if(path.contains("/")) {
            /* It's a relative file path*/
            file = new File(projectOwner.getProjectDirectory().getPath(), path);
        }else{
            /* It's an element name. Assume is a java file */
            String filePath=path.replace(".", "/")+DEFAULT_EXTENSION;
            Sources sources = ProjectUtils.getSources(projectOwner);
            SourceGroup[] sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
View Full Code Here

@Messages("CTL_GenerateClassAction=Generate Assets")
public final class GenerateClassAction implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        Project proj = OpenProjects.getDefault().getMainProject();
        if (proj != null) {
            try {
                FileObject root = proj.getProjectDirectory();
                final String path = root.getPath();
                File f = new File(path + "/assets");

                AssetFolder assetFolder = AssetsBuilder.getInstance().build(f);
    //            JCodeModel jcm = new JCodeModel();
View Full Code Here

    }

    public Set extend(WebModule wm) {
        Set retVal = new HashSet();
        final FileObject documentBase = wm.getDocumentBase();
        Project project = FileOwnerQuery.getOwner(documentBase);

        Library sipLibrary = LibraryManager.getDefault().getLibrary(libname);
        Sources s = project.getLookup().lookup(Sources.class);
        SourceGroup[] sources = null;
        if (null != s) {
            sources = s.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        }
        if (sipLibrary != null) {
View Full Code Here

     *
     * @return full paths to privileged templates, e.g. <samp>Templates/Other/XmlFile.xml</samp>; never null.
     */
    public String[] getPrivilegedTemplates(WebModule mod) {
        FileObject fo = mod.getWebInf();
        Project proj = FileOwnerQuery.getOwner(fo);
       
        if (sp.isInWebModule(mod)) {  // NOI18N
            return new String[] {
                "Templates/SIP_Servlet/SipServlet.java",        // NOI18N
                "Templates/SIP_Servlet/SipListener.java",       // NOI18N
View Full Code Here

    /**
     * Initialize panels representing individual wizard's steps and sets
     * various properties for them influencing wizard appearance.
     */
    private WizardDescriptor.Panel[] getPanels() {
        Project project = Templates.getProject(wizard);
        Sources sources = ProjectUtils.getSources(project);
        SourceGroup[] sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
        if (panels == null) {
            embedded = new SipListenerWizardPanel1();
            panels = new WizardDescriptor.Panel[]{
View Full Code Here

        return COMPLETION_QUERY_TYPE;
    }

    private Ivy getIvyInstance() {
        Ivy ivy = null;
        Project project = getProject();
        if (project != null) {
            IvyFacade facade = Lookup.getDefault().lookup(IvyFacade.class);
            try {
                ivy = facade.getIvy(project);
            } catch (IvyException ex) {
View Full Code Here

    private static class IvyMenusAction extends AbstractAction implements Presenter.Popup {

        private Project project;

        public IvyMenusAction(Lookup lkp) {
            Project _project = lkp.lookup(Project.class);
            ProjectPreferences preferences = _project.getLookup().lookup(ProjectPreferences.class);
            if (preferences == null) {
                setEnabled(false);
            } else {
                if (preferences.isIvyEnabled()){
                    this.project = _project;
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.