1.1 --- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/CompileDebugAction.java Tue Feb 19 16:39:13 2013 +0100
1.2 +++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/CompileDebugAction.java Wed Feb 20 15:23:50 2013 +0100
1.3 @@ -102,7 +102,7 @@
1.4
1.5 @Override
1.6 public void run() {
1.7 - final MakeConfiguration configuration = new MakeConfiguration (buildDir, "Default", MakeConfiguration.TYPE_MAKEFILE);// NOI18N
1.8 + final MakeConfiguration configuration = MakeConfiguration.createDefaultHostMakefileConfiguration(buildDir, "Default");// NOI18N
1.9 configuration.getMakefileConfiguration().getOutput().setValue(buildDir + "/" + executable);// NOI18N
1.10 final RunProfile profile = new RunProfile(configuration, null);
1.11 StringBuilder buf = new StringBuilder();
2.1 --- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/ProjectSupport.java Tue Feb 19 16:39:13 2013 +0100
2.2 +++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/actions/ProjectSupport.java Wed Feb 20 15:23:50 2013 +0100
2.3 @@ -475,9 +475,8 @@
2.4 if (seed.conf != null) {
2.5 seed.conf.setBaseDir(baseDir);
2.6 } else {
2.7 - seed.conf = new MakeConfiguration(baseDir,
2.8 - "Default", // NOI18N
2.9 - MakeConfiguration.TYPE_MAKEFILE);
2.10 + seed.conf = MakeConfiguration.createDefaultHostMakefileConfiguration(baseDir,
2.11 + "Default"); // NOI18N
2.12 }
2.13
2.14 populateConfiguration(seed);
2.15 @@ -499,9 +498,8 @@
2.16 if (seed.conf != null) {
2.17 seed.conf.setBaseDir(baseDir);
2.18 } else {
2.19 - seed.conf = new MakeConfiguration(baseDir,
2.20 - "Default", // NOI18N
2.21 - MakeConfiguration.TYPE_MAKEFILE);
2.22 + seed.conf = MakeConfiguration.createDefaultHostMakefileConfiguration(baseDir,
2.23 + "Default"); // NOI18N
2.24 }
2.25
2.26 // IZ 114302
3.1 --- a/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/debugtarget/DebugTarget.java Tue Feb 19 16:39:13 2013 +0100
3.2 +++ b/cnd.debugger.common2/src/org/netbeans/modules/cnd/debugger/common2/debugger/debugtarget/DebugTarget.java Wed Feb 20 15:23:50 2013 +0100
3.3 @@ -177,18 +177,16 @@
3.4 public DebugTarget( String name) {
3.5 this.engine = EngineTypeManager.getFallbackEnineType();
3.6 this.name = name;
3.7 - configuration = new MakeConfiguration (baseDir,
3.8 - "Default", // NOI18N
3.9 - MakeConfiguration.TYPE_MAKEFILE);
3.10 + configuration = MakeConfiguration.createDefaultHostMakefileConfiguration(baseDir,
3.11 + "Default"); // NOI18N
3.12 configuration.getMakefileConfiguration().
3.13 getOutput().setValue(name);
3.14 }
3.15
3.16 public DebugTarget() {
3.17 this.engine = EngineTypeManager.getFallbackEnineType();
3.18 - configuration = new MakeConfiguration (baseDir,
3.19 - "Default", // NOI18N
3.20 - MakeConfiguration.TYPE_MAKEFILE);
3.21 + configuration = MakeConfiguration.createDefaultHostMakefileConfiguration(baseDir,
3.22 + "Default");//NOI18N
3.23 }
3.24
3.25 public DebugTarget(MakeConfiguration f) {
4.1 --- a/cnd.discovery/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
4.2 +++ b/cnd.discovery/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
4.3 @@ -56,7 +56,7 @@
4.4 <compile-dependency/>
4.5 <run-dependency>
4.6 <release-version>2</release-version>
4.7 - <specification-version>2.33</specification-version>
4.8 + <specification-version>2.36</specification-version>
4.9 </run-dependency>
4.10 </dependency>
4.11 <dependency>
5.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/layer.xml Tue Feb 19 16:39:13 2013 +0100
5.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/layer.xml Wed Feb 20 15:23:50 2013 +0100
5.3 @@ -59,6 +59,7 @@
5.4 <folder name="DiskFolder">
5.5 <file name="org.netbeans.modules.cnd.discovery.projectimport.ReconfigureProjectAction.shadow">
5.6 <attr name="originalFile" stringvalue="Actions/Build/org.netbeans.modules.cnd.discovery.projectimport.ReconfigureProjectAction.instance"/>
5.7 + <attr name="position" intvalue="2500"/>
5.8 </file>
5.9 </folder>
5.10 </folder>
6.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/AnalyzeStat.java Tue Feb 19 16:39:13 2013 +0100
6.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/AnalyzeStat.java Wed Feb 20 15:23:50 2013 +0100
6.3 @@ -62,9 +62,9 @@
6.4
6.5 void process() {
6.6 upEmptyFolder();
6.7 - dumpAll();
6.8 getBigUnused();
6.9 groupByReadingSpeed();
6.10 + dumpAll();
6.11 getSlowReading();
6.12 }
6.13
6.14 @@ -129,11 +129,16 @@
6.15 return (int)(k2 - k1);
6.16 }
6.17 });
6.18 + i = 0;
6.19 for (Map.Entry<String, AgregatedStat> entry : slow) {
6.20 PerformanceIssueDetector.LOG.log(Level.INFO, "Slow reading files in the folder {0}. Reading {1} lines consumes {2}s.", // NOI18N
6.21 new Object[]{entry.getKey(),
6.22 PerformanceIssueDetector.format(entry.getValue().readLines),
6.23 PerformanceIssueDetector.format(entry.getValue().readTime/PerformanceIssueDetector.NANO_TO_SEC)});
6.24 + i++;
6.25 + if (i > 5) {
6.26 + break;
6.27 + }
6.28 }
6.29 }
6.30
7.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/NotifyProjectProblem.java Tue Feb 19 16:39:13 2013 +0100
7.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/NotifyProjectProblem.java Wed Feb 20 15:23:50 2013 +0100
7.3 @@ -60,17 +60,17 @@
7.4 @Messages({
7.5 "NotifyProjectProblem.title.text=Detected Project Performance Issues"
7.6 ,"NotifyProjectProblem.action.text=details"
7.7 - ,"NotifyProjectProblem.open.message.text=Slow Project Opening"
7.8 + ,"NotifyProjectProblem.open.message.text=Slow File System"
7.9 ,"# {0} - details"
7.10 ,"NotifyProjectProblem.open.explanation.text=The IDE has detected slowness while opening the project.<br>\n"
7.11 +"Details:<br>\n"
7.12 +"{0}"
7.13 - ,"NotifyProjectProblem.read.message.text=Slow Project Files Reading"
7.14 + ,"NotifyProjectProblem.read.message.text=Slow File System"
7.15 ,"# {0} - details"
7.16 ,"NotifyProjectProblem.read.explanation.text=The IDE has detected slowness while reading project files.<br>\n"
7.17 +"Details:<br>\n"
7.18 +"{0}"
7.19 - ,"NotifyProjectProblem.parse.message.text=Slow Project Parsing"
7.20 + ,"NotifyProjectProblem.parse.message.text=Slow File System"
7.21 ,"# {0} - details"
7.22 ,"NotifyProjectProblem.parse.explanation.text=The IDE has detected slowness while parsing project files.<br>\n"
7.23 +"Details:<br>\n"
8.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/PerformanceIssueDetector.java Tue Feb 19 16:39:13 2013 +0100
8.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/PerformanceIssueDetector.java Wed Feb 20 15:23:50 2013 +0100
8.3 @@ -435,6 +435,10 @@
8.4 return true;
8.5 }
8.6
8.7 + private boolean alreadyNotified() {
8.8 + return slowFileRead || slowItemCreation || slowParsed;
8.9 + }
8.10 +
8.11 private void notifyProblem(final int problem, final String details) {
8.12 SwingUtilities.invokeLater(new Runnable() {
8.13 @Override
8.14 @@ -530,7 +534,6 @@
8.15 })
8.16 private void analyzeCreateItems() {
8.17 int CREATION_SPEED_LIMIT = 100;
8.18 - int CREATION_SPEED_EXPECTED = 1000;
8.19 long itemCount = 0;
8.20 long time = 0;
8.21 long cpu = 0;
8.22 @@ -547,9 +550,9 @@
8.23 long wallTime = time/NANO_TO_SEC;
8.24 long creationSpeed = (itemCount*NANO_TO_SEC)/time;
8.25 if (wallTime > 15 && itemCount > 100 && creationSpeed < CREATION_SPEED_LIMIT) {
8.26 - if (!slowItemCreation) {
8.27 + if (!alreadyNotified()) {
8.28 slowItemCreation = true;
8.29 - final String details = Bundle.Details_slow_item_creation(format(wallTime), format(itemCount), format(creationSpeed), format(CREATION_SPEED_EXPECTED));
8.30 + final String details = Bundle.Details_slow_item_creation(format(wallTime), format(itemCount), format(creationSpeed), format(CREATION_SPEED_LIMIT));
8.31 if (!CndUtils.isUnitTestMode() && !CndUtils.isStandalone() && canNotify()) {
8.32 notifyProblem(NotifyProjectProblem.CREATE_PROBLEM, details);
8.33 }
8.34 @@ -572,7 +575,6 @@
8.35 })
8.36 private void analyzeReadFile() {
8.37 int READING_SPEED_LIMIT = 100;
8.38 - int READING_SPEED_EXPECTED = 1000;
8.39 long fileCount = 0;
8.40 long read = 0;
8.41 long lines = 0;
8.42 @@ -593,9 +595,9 @@
8.43 long wallTime = time/NANO_TO_SEC;
8.44 long readSpeed = (read*1000*1000)/time;
8.45 if (wallTime > 100 && fileCount > 100 && readSpeed < READING_SPEED_LIMIT) {
8.46 - if (!slowFileRead) {
8.47 + if (!alreadyNotified()) {
8.48 slowFileRead = true;
8.49 - final String details = Bundle.Details_slow_file_read(format(wallTime), format(read/1000), format(readSpeed), format(READING_SPEED_EXPECTED));
8.50 + final String details = Bundle.Details_slow_file_read(format(wallTime), format(read/1000), format(readSpeed), format(READING_SPEED_LIMIT));
8.51 if (!CndUtils.isUnitTestMode() && !CndUtils.isStandalone() && canNotify()) {
8.52 notifyProblem(NotifyProjectProblem.READ_PROBLEM, details);
8.53 }
8.54 @@ -617,7 +619,7 @@
8.55 +"The average parsing speed is {2} lines per second.<br>\n"
8.56 +"In other hand IDE consumed {3} seconds of CPU time to parse these files.<br>\n"
8.57 +"The ratio of wall time to CPU time is 1/{4}.<br>\n"
8.58 - +"It shows that IDE spent too mach time waiting for resources.<br>\n"
8.59 + +"It shows that IDE spent too much time waiting for resources.<br>\n"
8.60 +"IDE expects the ratio is more than 1/{5}.<br>\n"
8.61 +"Most probably this is caused by poor overall file system performance.\n"
8.62 })
8.63 @@ -647,7 +649,7 @@
8.64 if (cpuTime > 1) {
8.65 long k = time/cpu;
8.66 if (wallTime > 100 && fileCount > 100 && parseSpeed < 1000 && k > 5) {
8.67 - if (!slowParsed) {
8.68 + if (!alreadyNotified()) {
8.69 slowParsed = true;
8.70 final String details = Bundle.Details_slow_file_parse(format(wallTime), format(lines), format(parseSpeed), format(cpuTime), format(k), format(RATIO_LIMIT));
8.71 if (!CndUtils.isUnitTestMode() && !CndUtils.isStandalone() && canNotify()) {
8.72 @@ -684,8 +686,17 @@
8.73 long delta = (System.nanoTime() - event.getStartTime())/NANO_TO_SEC;
8.74 if (delta > 100) {
8.75 iterator.remove();
8.76 - buf.append(Bundle.Details_infinite_file_parse(fo.getPath(), format(delta)));
8.77 - LOG.log(Level.INFO, "Too long file {0} parsing time {1}s. Probably parser has infinite loop or file is too big", new Object[]{fo.getPath(), format(delta)}); //NOI18N
8.78 + long time = event.getTime();
8.79 + long cpu = event.getCpuTime();
8.80 + if (event.getAttrs().length == 0) {
8.81 + //TODO: process timeout
8.82 + if (time > cpu && cpu > 0) {
8.83 + if (time/cpu < 5) {
8.84 + buf.append(Bundle.Details_infinite_file_parse(fo.getPath(), format(delta)));
8.85 + LOG.log(Level.INFO, "Too long file {0} parsing time {1}s. Probably parser has infinite loop or file is too big", new Object[]{fo.getPath(), format(delta)}); //NOI18N
8.86 + }
8.87 + }
8.88 + }
8.89 }
8.90 }
8.91 if (buf.length() > 0) {
9.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/CreateDependencies.java Tue Feb 19 16:39:13 2013 +0100
9.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/CreateDependencies.java Wed Feb 20 15:23:50 2013 +0100
9.3 @@ -325,7 +325,7 @@
9.4 String projectParentFolder = ProjectGenerator.getDefaultProjectFolder();
9.5 String projectName = ProjectGenerator.getValidProjectName(projectParentFolder, new File(executablePath).getName());
9.6 String baseDir = projectParentFolder + File.separator + projectName;
9.7 - MakeConfiguration conf = new MakeConfiguration(baseDir, "Default", MakeConfiguration.TYPE_MAKEFILE); // NOI18N
9.8 + MakeConfiguration conf = MakeConfiguration.createDefaultHostMakefileConfiguration(baseDir, "Default"); // NOI18N
9.9 // Working dir
9.10 String wd = new File(executablePath).getParentFile().getPath();
9.11 wd = CndPathUtilitities.toRelativePath(baseDir, wd);
10.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/ImportExecutable.java Tue Feb 19 16:39:13 2013 +0100
10.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/ImportExecutable.java Wed Feb 20 15:23:50 2013 +0100
10.3 @@ -182,7 +182,7 @@
10.4 String hostUID = (String) map.get(WizardConstants.PROPERTY_HOST_UID);
10.5 CompilerSet toolchain = (CompilerSet) map.get(WizardConstants.PROPERTY_TOOLCHAIN);
10.6 boolean defaultToolchain = Boolean.TRUE.equals(map.get(WizardConstants.PROPERTY_TOOLCHAIN_DEFAULT));
10.7 - MakeConfiguration conf = new MakeConfiguration(projectFolder.getPath(), "Default", MakeConfiguration.TYPE_MAKEFILE, hostUID, toolchain, defaultToolchain); // NOI18N
10.8 + MakeConfiguration conf = MakeConfiguration.createMakefileConfiguration(projectFolder, "Default", hostUID, toolchain, defaultToolchain); // NOI18N
10.9 String workingDirRel = ProjectSupport.toProperPath(CndPathUtilitities.naturalizeSlashes(baseDir), sourcesPath,
10.10 MakeProjectOptions.getPathMode()); // it's better to pass project source mode here (once full remote is supprted here)
10.11 conf.getMakefileConfiguration().getBuildCommandWorkingDir().setValue(workingDirRel);
11.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/ImportProject.java Tue Feb 19 16:39:13 2013 +0100
11.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/ImportProject.java Wed Feb 20 15:23:50 2013 +0100
11.3 @@ -61,6 +61,7 @@
11.4 import java.util.Set;
11.5 import java.util.StringTokenizer;
11.6 import java.util.WeakHashMap;
11.7 +import java.util.concurrent.CountDownLatch;
11.8 import java.util.concurrent.ExecutionException;
11.9 import java.util.concurrent.Future;
11.10 import java.util.logging.Level;
11.11 @@ -193,7 +194,7 @@
11.12 private String sourceFoldersFilter = null;
11.13 private FileObject configureFileObject;
11.14 private Map<Step, State> importResult = new EnumMap<Step, State>(Step.class);
11.15 - private Task initSourceRootTask;
11.16 + private final CountDownLatch waitSources = new CountDownLatch(1);
11.17
11.18 public ImportProject(WizardDescriptor wizard) {
11.19 pathMode = MakeProjectOptions.getPathMode();
11.20 @@ -294,7 +295,7 @@
11.21
11.22 public Set<FileObject> create() throws IOException {
11.23 Set<FileObject> resultSet = new HashSet<FileObject>();
11.24 - MakeConfiguration extConf = new MakeConfiguration(projectFolder.getPath(), "Default", MakeConfiguration.TYPE_MAKEFILE, hostUID, toolchain, defaultToolchain); // NOI18N
11.25 + MakeConfiguration extConf = MakeConfiguration.createConfiguration(projectFolder, "Default", MakeConfiguration.TYPE_MAKEFILE, null, hostUID, toolchain, defaultToolchain); // NOI18N
11.26 String workingDirRel = ProjectSupport.toProperPath(projectFolder.getPath(), CndPathUtilitities.naturalizeSlashes(workingDir), pathMode);
11.27 workingDirRel = CndPathUtilitities.normalizeSlashes(workingDirRel);
11.28 extConf.getMakefileConfiguration().getBuildCommandWorkingDir().setValue(workingDirRel);
11.29 @@ -413,18 +414,21 @@
11.30 if (pdp.gotDescriptor()) {
11.31 final MakeConfigurationDescriptor configurationDescriptor = pdp.getConfigurationDescriptor();
11.32 if (sources != null) {
11.33 - initSourceRootTask = RP.post(new Runnable() {
11.34 + RP.post(new Runnable() {
11.35 @Override
11.36 public void run() {
11.37 ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(ImportProject.class, "ImportProject.Progress.AnalyzeRoot"));
11.38 handle.start();
11.39 while(sources.hasNext()) {
11.40 SourceFolderInfo next = sources.next();
11.41 - configurationDescriptor.addFilesFromRoot(configurationDescriptor.getLogicalFolders(), next.getFileObject(), false, Folder.Kind.SOURCE_DISK_FOLDER, null);
11.42 + configurationDescriptor.addFilesFromRoot(configurationDescriptor.getLogicalFolders(), next.getFileObject(), handle, false, Folder.Kind.SOURCE_DISK_FOLDER, null);
11.43 }
11.44 handle.finish();
11.45 + waitSources.countDown();
11.46 }
11.47 });
11.48 + } else {
11.49 + waitSources.countDown();
11.50 }
11.51 if (configurationDescriptor.getActiveConfiguration() != null) {
11.52 if (runConfigure && configurePath != null && configurePath.length() > 0 &&
11.53 @@ -1039,8 +1043,9 @@
11.54 // Make sure that descriptor was stored and readed
11.55 ConfigurationDescriptorProvider provider = makeProject.getLookup().lookup(ConfigurationDescriptorProvider.class);
11.56 provider.getConfigurationDescriptor(true);
11.57 - if (initSourceRootTask != null) {
11.58 - initSourceRootTask.waitFinished();
11.59 + try {
11.60 + waitSources.await();
11.61 + } catch (InterruptedException ex) {
11.62 }
11.63 }
11.64
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/api/support/Bundle.properties Wed Feb 20 15:23:50 2013 +0100
12.3 @@ -0,0 +1,37 @@
12.4 +# This module is part of NetBeans and is open-source.
12.5 +# You can see http://www.netbeans.org/about/legal/index.html for details.
12.6 +#
12.7 +# You may use the binary however you like. The source file license is:
12.8 +#
12.9 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
12.10 +#
12.11 +# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
12.12 +#
12.13 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
12.14 +# Other names may be trademarks of their respective owners.
12.15 +#
12.16 +# The contents of this file are subject to the terms of either the GNU
12.17 +# General Public License Version 2 only ("GPL") or the Common
12.18 +# Development and Distribution License("CDDL") (collectively, the
12.19 +# "License"). You may not use this file except in compliance with the
12.20 +# License. You can obtain a copy of the License at
12.21 +# http://www.netbeans.org/cddl-gplv2.html
12.22 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12.23 +# specific language governing permissions and limitations under the
12.24 +# License. When distributing the software, include this License Header
12.25 +# Notice in each file and include the License file at
12.26 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
12.27 +# particular file as subject to the "Classpath" exception as provided
12.28 +# by Sun in the GPL Version 2 section of the License file that
12.29 +# accompanied this code. If applicable, add the following below the
12.30 +# License Header, with the fields enclosed by brackets [] replaced by
12.31 +# your own identifying information:
12.32 +# "Portions Copyrighted [year] [name of copyright owner]"
12.33 +#
12.34 +# Contributor(s):
12.35 +#
12.36 +# The Original Software is NetBeans. The Initial Developer of the Original
12.37 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
12.38 +# Microsystems, Inc. All Rights Reserved.
12.39 +
12.40 +FixInclude.Progress.AnalyzeRoot=Check Included Files...
13.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/api/support/DiscoveryProjectGenerator.java Tue Feb 19 16:39:13 2013 +0100
13.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/api/support/DiscoveryProjectGenerator.java Wed Feb 20 15:23:50 2013 +0100
13.3 @@ -49,6 +49,8 @@
13.4 import java.util.Set;
13.5 import java.util.logging.Level;
13.6 import java.util.logging.Logger;
13.7 +import org.netbeans.api.progress.ProgressHandle;
13.8 +import org.netbeans.api.progress.ProgressHandleFactory;
13.9 import org.netbeans.api.project.Project;
13.10 import org.netbeans.modules.cnd.api.model.CsmFile;
13.11 import org.netbeans.modules.cnd.api.model.CsmModel;
13.12 @@ -69,6 +71,7 @@
13.13 import org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl;
13.14 import org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase;
13.15 import org.netbeans.modules.cnd.utils.MIMENames;
13.16 +import org.openide.util.NbBundle;
13.17 import org.openide.util.Utilities;
13.18
13.19 /**
13.20 @@ -120,125 +123,131 @@
13.21 boolean isChanged = false;
13.22 Set<String> needCheck = new HashSet<String>();
13.23 Set<String> needAdd = new HashSet<String>();
13.24 - Map<String, Item> normalizedItems = DiscoveryProjectGenerator.initNormalizedNames(makeProject);
13.25 - for (CsmFile file : p.getAllFiles()) {
13.26 - if (file instanceof FileImpl) {
13.27 - FileImpl impl = (FileImpl) file;
13.28 - NativeFileItem item = impl.getNativeFileItem();
13.29 - if (item == null) {
13.30 - String path = impl.getAbsolutePath().toString();
13.31 - item = normalizedItems.get(path);
13.32 - }
13.33 - boolean isLineDirective = false;
13.34 - if (item != null
13.35 - && item.getLanguage() == NativeFileItem.Language.C_HEADER
13.36 - && (p instanceof ProjectBase)) {
13.37 - ProjectBase pb = (ProjectBase) p;
13.38 - Set<CsmFile> parentFiles = pb.getParentFiles(file);
13.39 - if (parentFiles.isEmpty()) {
13.40 - isLineDirective = true;
13.41 + ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(DiscoveryProjectGenerator.class, "FixInclude.Progress.AnalyzeRoot")); // NOI18N
13.42 + handle.start();
13.43 + try {
13.44 + Map<String, Item> normalizedItems = DiscoveryProjectGenerator.initNormalizedNames(makeProject);
13.45 + for (CsmFile file : p.getAllFiles()) {
13.46 + if (file instanceof FileImpl) {
13.47 + FileImpl impl = (FileImpl) file;
13.48 + NativeFileItem item = impl.getNativeFileItem();
13.49 + if (item == null) {
13.50 + String path = impl.getAbsolutePath().toString();
13.51 + item = normalizedItems.get(path);
13.52 }
13.53 - }
13.54 - if (item != null && np.equals(item.getNativeProject()) && item.isExcluded()) {
13.55 - if (item instanceof Item) {
13.56 - if (logger != null) {
13.57 - logger.log(Level.FINE, "#fix excluded->included header for file {0}", impl.getAbsolutePath()); // NOI18N
13.58 - }
13.59 - if (true || !ConfigurationDescriptorProvider.VCS_WRITE) {
13.60 - ProjectBridge.setExclude((Item) item, false);
13.61 - }
13.62 - ProjectBridge.setHeaderTool((Item) item);
13.63 - isChanged = true;
13.64 - if (file.isHeaderFile()) {
13.65 - needCheck.add(item.getAbsolutePath());
13.66 + boolean isLineDirective = false;
13.67 + if (item != null
13.68 + && item.getLanguage() == NativeFileItem.Language.C_HEADER
13.69 + && (p instanceof ProjectBase)) {
13.70 + ProjectBase pb = (ProjectBase) p;
13.71 + Set<CsmFile> parentFiles = pb.getParentFiles(file);
13.72 + if (parentFiles.isEmpty()) {
13.73 + isLineDirective = true;
13.74 }
13.75 }
13.76 - } else if (isLineDirective && item != null && np.equals(item.getNativeProject()) && !item.isExcluded()) {
13.77 - if (item instanceof Item) {
13.78 - if (logger != null) {
13.79 - logger.log(Level.FINE, "#fix included->excluded for file {0}", impl.getAbsolutePath()); // NOI18N
13.80 + if (item != null && np.equals(item.getNativeProject()) && item.isExcluded()) {
13.81 + if (item instanceof Item) {
13.82 + if (logger != null) {
13.83 + logger.log(Level.FINE, "#fix excluded->included header for file {0}", impl.getAbsolutePath()); // NOI18N
13.84 + }
13.85 + if (true || !ConfigurationDescriptorProvider.VCS_WRITE) {
13.86 + ProjectBridge.setExclude((Item) item, false);
13.87 + }
13.88 + ProjectBridge.setHeaderTool((Item) item);
13.89 + isChanged = true;
13.90 + if (file.isHeaderFile()) {
13.91 + needCheck.add(item.getAbsolutePath());
13.92 + }
13.93 }
13.94 - ProjectBridge.setExclude((Item) item, true);
13.95 - isChanged = true;
13.96 - }
13.97 - } else if (item == null) {
13.98 - // It should be in project?
13.99 - if (file.isHeaderFile()) {
13.100 - String path = impl.getAbsolutePath().toString();
13.101 - needAdd.add(path);
13.102 + } else if (isLineDirective && item != null && np.equals(item.getNativeProject()) && !item.isExcluded()) {
13.103 + if (item instanceof Item) {
13.104 + if (logger != null) {
13.105 + logger.log(Level.FINE, "#fix included->excluded for file {0}", impl.getAbsolutePath()); // NOI18N
13.106 + }
13.107 + ProjectBridge.setExclude((Item) item, true);
13.108 + isChanged = true;
13.109 + }
13.110 + } else if (item == null) {
13.111 + // It should be in project?
13.112 + if (file.isHeaderFile()) {
13.113 + String path = impl.getAbsolutePath().toString();
13.114 + needAdd.add(path);
13.115 + }
13.116 }
13.117 }
13.118 }
13.119 - }
13.120 - if (needCheck.size() > 0 || needAdd.size() > 0) {
13.121 - ProjectBridge bridge = new ProjectBridge(makeProject);
13.122 - if (bridge.isValid()) {
13.123 - if (needAdd.size() > 0) {
13.124 - Map<String, Folder> prefferedFolders = bridge.prefferedFolders();
13.125 - for (String path : needAdd) {
13.126 - String name = path;
13.127 - if (Utilities.isWindows()) {
13.128 - path = path.replace('\\', '/'); // NOI18N
13.129 - }
13.130 - int i = path.lastIndexOf('/'); // NOI18N
13.131 - if (i >= 0) {
13.132 - String folderPath = path.substring(0, i);
13.133 - Folder prefferedFolder = prefferedFolders.get(folderPath);
13.134 - if (prefferedFolder == null) {
13.135 - LinkedList<String> mkFolder = new LinkedList<String>();
13.136 - while (true) {
13.137 - i = folderPath.lastIndexOf('/'); // NOI18N
13.138 - if (i > 0) {
13.139 - mkFolder.addLast(folderPath.substring(i + 1));
13.140 - folderPath = folderPath.substring(0, i);
13.141 - prefferedFolder = prefferedFolders.get(folderPath);
13.142 - if (prefferedFolder != null) {
13.143 + if (needCheck.size() > 0 || needAdd.size() > 0) {
13.144 + ProjectBridge bridge = new ProjectBridge(makeProject);
13.145 + if (bridge.isValid()) {
13.146 + if (needAdd.size() > 0) {
13.147 + Map<String, Folder> prefferedFolders = bridge.prefferedFolders();
13.148 + for (String path : needAdd) {
13.149 + String name = path;
13.150 + if (Utilities.isWindows()) {
13.151 + path = path.replace('\\', '/'); // NOI18N
13.152 + }
13.153 + int i = path.lastIndexOf('/'); // NOI18N
13.154 + if (i >= 0) {
13.155 + String folderPath = path.substring(0, i);
13.156 + Folder prefferedFolder = prefferedFolders.get(folderPath);
13.157 + if (prefferedFolder == null) {
13.158 + LinkedList<String> mkFolder = new LinkedList<String>();
13.159 + while (true) {
13.160 + i = folderPath.lastIndexOf('/'); // NOI18N
13.161 + if (i > 0) {
13.162 + mkFolder.addLast(folderPath.substring(i + 1));
13.163 + folderPath = folderPath.substring(0, i);
13.164 + prefferedFolder = prefferedFolders.get(folderPath);
13.165 + if (prefferedFolder != null) {
13.166 + break;
13.167 + }
13.168 + } else {
13.169 break;
13.170 }
13.171 - } else {
13.172 - break;
13.173 + }
13.174 + if (prefferedFolder != null) {
13.175 + while (true) {
13.176 + if (mkFolder.isEmpty()) {
13.177 + break;
13.178 + }
13.179 + String segment = mkFolder.pollLast();
13.180 + prefferedFolder = prefferedFolder.addNewFolder(segment, segment, true, (Folder.Kind) null);
13.181 + folderPath += "/" + segment; // NOI18N
13.182 + prefferedFolders.put(folderPath, prefferedFolder);
13.183 + }
13.184 }
13.185 }
13.186 if (prefferedFolder != null) {
13.187 - while (true) {
13.188 - if (mkFolder.isEmpty()) {
13.189 - break;
13.190 + String relPath = bridge.getRelativepath(name);
13.191 + Item item = bridge.getProjectItem(relPath);
13.192 + if (item == null) {
13.193 + item = bridge.createItem(name);
13.194 + item = prefferedFolder.addItem(item);
13.195 + }
13.196 + if (item != null) {
13.197 + ProjectBridge.setHeaderTool(item);
13.198 + isChanged = true;
13.199 + if (!MIMENames.isCppOrCOrFortran(item.getMIMEType())) {
13.200 + needCheck.add(path);
13.201 }
13.202 - String segment = mkFolder.pollLast();
13.203 - prefferedFolder = prefferedFolder.addNewFolder(segment, segment, true, (Folder.Kind) null);
13.204 - folderPath += "/" + segment; // NOI18N
13.205 - prefferedFolders.put(folderPath, prefferedFolder);
13.206 + ProjectBridge.excludeItemFromOtherConfigurations(item);
13.207 }
13.208 }
13.209 }
13.210 - if (prefferedFolder != null) {
13.211 - String relPath = bridge.getRelativepath(name);
13.212 - Item item = bridge.getProjectItem(relPath);
13.213 - if (item == null) {
13.214 - item = bridge.createItem(name);
13.215 - item = prefferedFolder.addItem(item);
13.216 - }
13.217 - if (item != null) {
13.218 - ProjectBridge.setHeaderTool(item);
13.219 - isChanged = true;
13.220 - if (!MIMENames.isCppOrCOrFortran(item.getMIMEType())) {
13.221 - needCheck.add(path);
13.222 - }
13.223 - ProjectBridge.excludeItemFromOtherConfigurations(item);
13.224 - }
13.225 - }
13.226 }
13.227 }
13.228 - }
13.229 - if (needCheck.size() > 0) {
13.230 - isChanged |= bridge.checkForNewExtensions(needCheck);
13.231 + if (needCheck.size() > 0) {
13.232 + isChanged |= bridge.checkForNewExtensions(needCheck);
13.233 + }
13.234 }
13.235 }
13.236 - }
13.237 - if (isChanged) {
13.238 - saveMakeConfigurationDescriptor(makeProject, delta);
13.239 - } else {
13.240 - pdp.endModifications(delta, false, null);
13.241 + if (isChanged) {
13.242 + saveMakeConfigurationDescriptor(makeProject, delta);
13.243 + } else {
13.244 + pdp.endModifications(delta, false, null);
13.245 + }
13.246 + } finally {
13.247 + handle.finish();
13.248 }
13.249 return isChanged;
13.250 }
14.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/api/support/ProjectBridge.java Tue Feb 19 16:39:13 2013 +0100
14.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/api/support/ProjectBridge.java Wed Feb 20 15:23:50 2013 +0100
14.3 @@ -79,6 +79,7 @@
14.4 import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
14.5 import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor;
14.6 import org.netbeans.modules.cnd.utils.CndPathUtilitities;
14.7 +import org.netbeans.modules.cnd.utils.FSPath;
14.8 import org.netbeans.modules.cnd.utils.MIMENames;
14.9 import org.netbeans.modules.cnd.utils.cache.CndFileUtils;
14.10 import org.netbeans.modules.nativeexecution.api.util.HostInfoUtils;
14.11 @@ -128,7 +129,7 @@
14.12 public ProjectBridge(String baseFolder) throws IOException{
14.13 this.baseFolder = baseFolder;
14.14 // TODO: create localhost based project
14.15 - MakeConfiguration extConf = new MakeConfiguration(baseFolder, "Default", MakeConfiguration.TYPE_MAKEFILE, HostInfoUtils.LOCALHOST); // NOI18N
14.16 + MakeConfiguration extConf = MakeConfiguration.createMakefileConfiguration(new FSPath(CndFileUtils.getLocalFileSystem(), baseFolder), "Default", HostInfoUtils.LOCALHOST); // NOI18N
14.17 String workingDir = baseFolder;
14.18 String workingDirRel = CndPathUtilitities.toRelativePath(baseFolder, CndPathUtilitities.naturalizeSlashes(workingDir));
14.19 workingDirRel = CndPathUtilitities.normalizeSlashes(workingDirRel);
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/support/impl/Bundle.properties Wed Feb 20 15:23:50 2013 +0100
15.3 @@ -0,0 +1,37 @@
15.4 +# This module is part of NetBeans and is open-source.
15.5 +# You can see http://www.netbeans.org/about/legal/index.html for details.
15.6 +#
15.7 +# You may use the binary however you like. The source file license is:
15.8 +#
15.9 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
15.10 +#
15.11 +# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
15.12 +#
15.13 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
15.14 +# Other names may be trademarks of their respective owners.
15.15 +#
15.16 +# The contents of this file are subject to the terms of either the GNU
15.17 +# General Public License Version 2 only ("GPL") or the Common
15.18 +# Development and Distribution License("CDDL") (collectively, the
15.19 +# "License"). You may not use this file except in compliance with the
15.20 +# License. You can obtain a copy of the License at
15.21 +# http://www.netbeans.org/cddl-gplv2.html
15.22 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15.23 +# specific language governing permissions and limitations under the
15.24 +# License. When distributing the software, include this License Header
15.25 +# Notice in each file and include the License file at
15.26 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
15.27 +# particular file as subject to the "Classpath" exception as provided
15.28 +# by Sun in the GPL Version 2 section of the License file that
15.29 +# accompanied this code. If applicable, add the following below the
15.30 +# License Header, with the fields enclosed by brackets [] replaced by
15.31 +# your own identifying information:
15.32 +# "Portions Copyrighted [year] [name of copyright owner]"
15.33 +#
15.34 +# Contributor(s):
15.35 +#
15.36 +# The Original Software is NetBeans. The Initial Developer of the Original
15.37 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
15.38 +# Microsystems, Inc. All Rights Reserved.
15.39 +
15.40 +UpdateCodeAssistance=Update Code Assistance
15.41 \ No newline at end of file
16.1 --- a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/support/impl/DiscoveryProjectGeneratorImpl.java Tue Feb 19 16:39:13 2013 +0100
16.2 +++ b/cnd.discovery/src/org/netbeans/modules/cnd/discovery/wizard/support/impl/DiscoveryProjectGeneratorImpl.java Wed Feb 20 15:23:50 2013 +0100
16.3 @@ -56,6 +56,8 @@
16.4 import java.util.Map;
16.5 import java.util.Set;
16.6 import java.util.TreeMap;
16.7 +import org.netbeans.api.progress.ProgressHandle;
16.8 +import org.netbeans.api.progress.ProgressHandleFactory;
16.9 import org.netbeans.api.project.Project;
16.10 import org.netbeans.modules.cnd.discovery.api.ItemProperties;
16.11 import org.netbeans.modules.cnd.discovery.api.ItemProperties.LanguageKind;
16.12 @@ -79,6 +81,7 @@
16.13 import org.netbeans.modules.cnd.utils.CndPathUtilitities;
16.14 import org.netbeans.modules.cnd.utils.MIMENames;
16.15 import org.openide.filesystems.FileObject;
16.16 +import org.openide.util.NbBundle;
16.17 import org.openide.util.Utilities;
16.18
16.19 /**
16.20 @@ -628,12 +631,18 @@
16.21 }
16.22
16.23 public Set<Project> makeProject(){
16.24 - if (projectBridge.isValid() && wizard.getConfigurations() != null && wizard.getConfigurations().size() > 0) {
16.25 - projectBridge.startModifications();
16.26 - process();
16.27 - return projectBridge.getResult();
16.28 + ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(DiscoveryProjectGeneratorImpl.class, "UpdateCodeAssistance"));
16.29 + handle.start();
16.30 + try {
16.31 + if (projectBridge.isValid() && wizard.getConfigurations() != null && wizard.getConfigurations().size() > 0) {
16.32 + projectBridge.startModifications();
16.33 + process();
16.34 + return projectBridge.getResult();
16.35 + }
16.36 + return Collections.<Project>emptySet();
16.37 + } finally {
16.38 + handle.finish();
16.39 }
16.40 - return Collections.<Project>emptySet();
16.41 }
16.42
16.43 private Set<String> getSourceFolders(){
17.1 --- a/cnd.makeproject/nbproject/project.properties Tue Feb 19 16:39:13 2013 +0100
17.2 +++ b/cnd.makeproject/nbproject/project.properties Wed Feb 20 15:23:50 2013 +0100
17.3 @@ -3,7 +3,7 @@
17.4
17.5 sigtest.mail=cvs@cnd.netbeans.org
17.6
17.7 -spec.version.base=2.34
17.8 +spec.version.base=2.36
17.9
17.10 test.config.stableBTD.includes=**/*Test.class
17.11 test.config.stableBTD.excludes=\
18.1 --- a/cnd.makeproject/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
18.2 +++ b/cnd.makeproject/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
18.3 @@ -345,8 +345,9 @@
18.4 <friend>com.microchip.mplab.nbide.embedded.makeproject</friend>
18.5 <friend>com.microchip.mplab.nbide.emcee</friend>
18.6 <friend>com.microchip.mplab.nbide.toolchains</friend>
18.7 + <friend>com.oracle.tools.ide.launchers</friend>
18.8 + <friend>com.oracle.tools.ide.projectless.debug.impl</friend>
18.9 <friend>com.oracle.tools.ide.projectless.impl</friend>
18.10 - <friend>com.oracle.tools.ide.projectless.debug.impl</friend>
18.11 <friend>com.sun.cloud.cnd</friend>
18.12 <friend>com.sun.cloud.cnd.remote.ext</friend>
18.13 <friend>com.sun.tools.cnd.accessor</friend>
19.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeActionProvider.java Tue Feb 19 16:39:13 2013 +0100
19.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeActionProvider.java Wed Feb 20 15:23:50 2013 +0100
19.3 @@ -62,6 +62,7 @@
19.4 import javax.swing.SwingUtilities;
19.5 import org.netbeans.api.project.ProjectUtils;
19.6 import org.netbeans.modules.cnd.actions.ShellRunAction;
19.7 +import org.netbeans.modules.cnd.api.picklist.DefaultPicklistModel;
19.8 import org.netbeans.modules.cnd.api.remote.HostInfoProvider;
19.9 import org.netbeans.modules.cnd.api.remote.RemoteProject;
19.10 import org.netbeans.modules.cnd.api.remote.ServerList;
19.11 @@ -93,6 +94,8 @@
19.12 import org.netbeans.modules.cnd.makeproject.api.configurations.AssemblerConfiguration;
19.13 import org.netbeans.modules.cnd.makeproject.api.configurations.CCCompilerConfiguration;
19.14 import org.netbeans.modules.cnd.makeproject.api.configurations.CCompilerConfiguration;
19.15 +import org.netbeans.modules.cnd.makeproject.api.configurations.ComboStringConfiguration;
19.16 +import org.netbeans.modules.cnd.makeproject.api.configurations.CompileConfiguration;
19.17 import org.netbeans.modules.cnd.makeproject.api.configurations.CompilerSet2Configuration;
19.18 import org.netbeans.modules.cnd.makeproject.api.configurations.Configuration;
19.19 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
19.20 @@ -130,6 +133,7 @@
19.21 import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport;
19.22 import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport.ShellValidationStatus;
19.23 import org.netbeans.modules.nativeexecution.api.util.WindowsSupport;
19.24 +import org.netbeans.modules.remote.spi.FileSystemProvider;
19.25 import org.netbeans.spi.project.ActionProvider;
19.26 import org.netbeans.spi.project.ui.support.DefaultProjectOperations;
19.27 import org.openide.DialogDescriptor;
19.28 @@ -960,31 +964,104 @@
19.29 if (ccCompiler == null) {
19.30 return false;
19.31 }
19.32 - AllOptionsProvider options = CompileOptionsProvider.getDefault().getOptions(item);
19.33 - if (options != null) {
19.34 - String compileLine = options.getAllOptions(ccCompiler);
19.35 - if (compileLine != null) {
19.36 - int hasPath = compileLine.indexOf('#');// NOI18N
19.37 - if (hasPath >= 0) {
19.38 + CompileConfiguration compileConfiguration = conf.getCompileConfiguration();
19.39 + if (CompileConfiguration.AUTO_COMPILE.equals(compileConfiguration.getCompileCommand().getValue())) {
19.40 + //auto
19.41 + AllOptionsProvider options = CompileOptionsProvider.getDefault().getOptions(item);
19.42 + if (options != null) {
19.43 + String compileLine = options.getAllOptions(ccCompiler);
19.44 + if (compileLine != null) {
19.45 + int hasPath = compileLine.indexOf('#');// NOI18N
19.46 + if (hasPath >= 0) {
19.47 + RunProfile profile = new RunProfile(makeArtifact.getWorkingDirectory(), conf.getDevelopmentHost().getBuildPlatform(), conf);
19.48 + profile.setRunDirectory(compileLine.substring(0, hasPath));
19.49 + String command = compileLine.substring(hasPath+1).trim();
19.50 + if (command.length() > 0 && command.charAt(0) != '-') {// NOI18N
19.51 + int i = command.indexOf(' ');
19.52 + if (i > 0) {
19.53 + command = command.substring(i+1).trim();
19.54 + }
19.55 + }
19.56 + profile.setArgs(command);
19.57 + String compilerPath = convertPath(ccCompiler.getPath(), conf.getDevelopmentHost().getExecutionEnvironment());
19.58 + ExecutionEnvironment ee = conf.getDevelopmentHost().getExecutionEnvironment();
19.59 + if (ee.isLocal() && Utilities.isWindows()) {
19.60 + try {
19.61 + compilerPath = compilerPath.replace('\\', '/'); // NOI18N
19.62 + command = escapeQuotes(command);
19.63 + profile.setArgs(new String[]{"-c", "\"'"+compilerPath+"' "+command+"\""}); // NOI18N
19.64 + HostInfo hostInfo = HostInfoUtils.getHostInfo(ee);
19.65 + compilerPath = hostInfo.getShell();
19.66 + } catch (IOException ex) {
19.67 + return false;
19.68 + } catch (CancellationException ex) {
19.69 + return false;
19.70 + }
19.71 + }
19.72 + ProjectActionEvent projectActionEvent = new ProjectActionEvent(project, actionEvent, compilerPath, conf, profile, true, context);
19.73 + actionEvents.add(projectActionEvent);
19.74 + return true;
19.75 + }
19.76 + }
19.77 + } else if (optionProvider != null) {
19.78 + String compileLine = optionProvider.getAllOptions(ccCompiler);
19.79 + if (compileLine != null) {
19.80 RunProfile profile = new RunProfile(makeArtifact.getWorkingDirectory(), conf.getDevelopmentHost().getBuildPlatform(), conf);
19.81 - profile.setRunDirectory(compileLine.substring(0, hasPath));
19.82 - String command = compileLine.substring(hasPath+1).trim();
19.83 - if (command.length() > 0 && command.charAt(0) != '-') {// NOI18N
19.84 - int i = command.indexOf(' ');
19.85 - if (i > 0) {
19.86 - command = command.substring(i+1).trim();
19.87 + profile.setRunDirectory(makeArtifact.getWorkingDirectory());
19.88 + String command = compileLine.trim();
19.89 + List<String> parseArgs = ImportUtils.parseArgs(command);
19.90 + StringBuilder buf = new StringBuilder();
19.91 + for (int i = 0; i < parseArgs.size(); i++) {
19.92 + String s = parseArgs.get(i);
19.93 + String s2 = CndPathUtilitities.quoteIfNecessary(s);
19.94 + if (s.equals(s2)) {
19.95 + if (s.indexOf('"') > 0) {// NOI18N
19.96 + int j = s.indexOf("\\\"");// NOI18N
19.97 + if (j < 0) {
19.98 + s = s.replace("\"", "\\\"");// NOI18N
19.99 + }
19.100 + }
19.101 + } else {
19.102 + s = s2;
19.103 }
19.104 + if (buf.length()>0) {
19.105 + buf.append(' ');
19.106 + }
19.107 + buf.append(s);
19.108 }
19.109 + command = buf.toString();
19.110 + command = command+" -o "+getDevNull(conf.getDevelopmentHost().getExecutionEnvironment(), compilerSet); // NOI18N
19.111 + String source = item.getAbsolutePath();
19.112 + ExecutionEnvironment ee = conf.getDevelopmentHost().getExecutionEnvironment();
19.113 + boolean isWindows = ee.isLocal() && Utilities.isWindows();
19.114 + if (isWindows) {
19.115 + source = source.replace('\\', '/'); // NOI18N
19.116 + source = CppUtils.normalizeDriveLetter(compilerSet, source);
19.117 + source = "'"+source+"'"; // NOI18N
19.118 + }
19.119 + command = command+" -c "+source; // NOI18N
19.120 profile.setArgs(command);
19.121 String compilerPath = convertPath(ccCompiler.getPath(), conf.getDevelopmentHost().getExecutionEnvironment());
19.122 - ExecutionEnvironment ee = conf.getDevelopmentHost().getExecutionEnvironment();
19.123 - if (ee.isLocal() && Utilities.isWindows()) {
19.124 + if (isWindows) {
19.125 try {
19.126 + HostInfo hostInfo = HostInfoUtils.getHostInfo(ee);
19.127 compilerPath = compilerPath.replace('\\', '/'); // NOI18N
19.128 command = escapeQuotes(command);
19.129 profile.setArgs(new String[]{"-c", "\"'"+compilerPath+"' "+command+"\""}); // NOI18N
19.130 - HostInfo hostInfo = HostInfoUtils.getHostInfo(ee);
19.131 - compilerPath = hostInfo.getShell();
19.132 + Shell shell = WindowsSupport.getInstance().getActiveShell();
19.133 + String shellPath = hostInfo.getShell();
19.134 + if (shell.type == Shell.ShellType.CYGWIN && compilerSet.getCompilerFlavor().isMinGWCompiler()) {
19.135 + Tool make = compilerSet.findTool(PredefinedToolKind.MakeTool);
19.136 + if (make != null) {
19.137 + String path = make.getPath();
19.138 + String dir = CndPathUtilitities.getDirName(path);
19.139 + if (dir != null && !dir.isEmpty()) {
19.140 + shellPath = dir+"/sh.exe"; // NOI18N
19.141 + }
19.142 + }
19.143 + }
19.144 + shellPath = shellPath.replace('\\', '/'); // NOI18N
19.145 + compilerPath = shellPath;
19.146 } catch (IOException ex) {
19.147 return false;
19.148 } catch (CancellationException ex) {
19.149 @@ -996,75 +1073,42 @@
19.150 return true;
19.151 }
19.152 }
19.153 - } else if (optionProvider != null) {
19.154 - String compileLine = optionProvider.getAllOptions(ccCompiler);
19.155 - if (compileLine != null) {
19.156 - RunProfile profile = new RunProfile(makeArtifact.getWorkingDirectory(), conf.getDevelopmentHost().getBuildPlatform(), conf);
19.157 - profile.setRunDirectory(makeArtifact.getWorkingDirectory());
19.158 - String command = compileLine.trim();
19.159 - List<String> parseArgs = ImportUtils.parseArgs(command);
19.160 - StringBuilder buf = new StringBuilder();
19.161 - for (int i = 0; i < parseArgs.size(); i++) {
19.162 - String s = parseArgs.get(i);
19.163 - String s2 = CndPathUtilitities.quoteIfNecessary(s);
19.164 - if (s.equals(s2)) {
19.165 - if (s.indexOf('"') > 0) {// NOI18N
19.166 - int j = s.indexOf("\\\"");// NOI18N
19.167 - if (j < 0) {
19.168 - s = s.replace("\"", "\\\"");// NOI18N
19.169 - }
19.170 - }
19.171 - } else {
19.172 - s = s2;
19.173 - }
19.174 - if (buf.length()>0) {
19.175 - buf.append(' ');
19.176 - }
19.177 - buf.append(s);
19.178 + } else {
19.179 + // user command
19.180 + String command = compileConfiguration.getCompileCommand().getValue();
19.181 + if (command.indexOf(CompileConfiguration.AUTO_ITEM_PATH) >= 0) {
19.182 + command = command.replace(CompileConfiguration.AUTO_ITEM_PATH, item.getAbsolutePath());
19.183 + }
19.184 + if (command.indexOf(CompileConfiguration.AUTO_ITEM_NAME) >= 0) {
19.185 + String name = item.getName();
19.186 + if (name.indexOf('.') > 0) {
19.187 + name = name.substring(0, name.lastIndexOf('.'));
19.188 }
19.189 - command = buf.toString();
19.190 - command = command+" -o "+getDevNull(conf.getDevelopmentHost().getExecutionEnvironment(), compilerSet); // NOI18N
19.191 - String source = item.getAbsolutePath();
19.192 - ExecutionEnvironment ee = conf.getDevelopmentHost().getExecutionEnvironment();
19.193 - boolean isWindows = ee.isLocal() && Utilities.isWindows();
19.194 - if (isWindows) {
19.195 - source = source.replace('\\', '/'); // NOI18N
19.196 - source = CppUtils.normalizeDriveLetter(compilerSet, source);
19.197 - source = "'"+source+"'"; // NOI18N
19.198 + command = command.replace(CompileConfiguration.AUTO_ITEM_NAME, name);
19.199 + }
19.200 + if (command.indexOf(CompileConfiguration.AUTO_MAKE) >= 0) {
19.201 + String make = "make"; // NOI18N
19.202 + Tool makeTool = compilerSet.findTool(PredefinedToolKind.MakeTool);
19.203 + if (makeTool != null && makeTool.getPath().length() > 0) {
19.204 + make = makeTool.getPath();
19.205 }
19.206 - command = command+" -c "+source; // NOI18N
19.207 - profile.setArgs(command);
19.208 - String compilerPath = convertPath(ccCompiler.getPath(), conf.getDevelopmentHost().getExecutionEnvironment());
19.209 - if (isWindows) {
19.210 - try {
19.211 - HostInfo hostInfo = HostInfoUtils.getHostInfo(ee);
19.212 - compilerPath = compilerPath.replace('\\', '/'); // NOI18N
19.213 - command = escapeQuotes(command);
19.214 - profile.setArgs(new String[]{"-c", "\"'"+compilerPath+"' "+command+"\""}); // NOI18N
19.215 - Shell shell = WindowsSupport.getInstance().getActiveShell();
19.216 - String shellPath = hostInfo.getShell();
19.217 - if (shell.type == Shell.ShellType.CYGWIN && compilerSet.getCompilerFlavor().isMinGWCompiler()) {
19.218 - Tool make = compilerSet.findTool(PredefinedToolKind.MakeTool);
19.219 - if (make != null) {
19.220 - String path = make.getPath();
19.221 - String dir = CndPathUtilitities.getDirName(path);
19.222 - if (dir != null && !dir.isEmpty()) {
19.223 - shellPath = dir+"/sh.exe"; // NOI18N
19.224 - }
19.225 - }
19.226 - }
19.227 - shellPath = shellPath.replace('\\', '/'); // NOI18N
19.228 - compilerPath = shellPath;
19.229 - } catch (IOException ex) {
19.230 - return false;
19.231 - } catch (CancellationException ex) {
19.232 - return false;
19.233 - }
19.234 + command = command.replace(CompileConfiguration.AUTO_MAKE, make);
19.235 + }
19.236 + String workingDir = compileConfiguration.getCompileCommandWorkingDir().getValue();
19.237 + if (CompileConfiguration.AUTO_FOLDER.equals(workingDir)) {
19.238 + workingDir = CndPathUtilitities.getDirName(item.getAbsolutePath());
19.239 + } else {
19.240 + if (!CndPathUtilitities.isPathAbsolute(workingDir)) {
19.241 + workingDir = conf.getSourceBaseDir() + "/" + workingDir; // NOI18N
19.242 }
19.243 - ProjectActionEvent projectActionEvent = new ProjectActionEvent(project, actionEvent, compilerPath, conf, profile, true, context);
19.244 - actionEvents.add(projectActionEvent);
19.245 - return true;
19.246 + workingDir = FileSystemProvider.normalizeAbsolutePath(workingDir, conf.getSourceFileSystem());
19.247 }
19.248 + RunProfile profile = new RunProfile(workingDir, conf.getDevelopmentHost().getBuildPlatform(), conf);
19.249 + profile.setRunDirectory(workingDir);
19.250 + profile.setRunCommand(new ComboStringConfiguration(null, command, new DefaultPicklistModel()));
19.251 + ProjectActionEvent projectActionEvent = new ProjectActionEvent(project, actionEvent, workingDir, conf, profile, true, context);
19.252 + actionEvents.add(projectActionEvent);
19.253 + return true;
19.254 }
19.255 return false;
19.256 }
20.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeProjectTypeImpl.java Tue Feb 19 16:39:13 2013 +0100
20.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeProjectTypeImpl.java Wed Feb 20 15:23:50 2013 +0100
20.3 @@ -59,6 +59,7 @@
20.4 public final class MakeProjectTypeImpl implements NativeProjectType {
20.5
20.6 public static final String TYPE = "org.netbeans.modules.cnd.makeproject"; // NOI18N
20.7 + public static final String PROJECT_TYPE = "org-netbeans-modules-cnd-makeproject";//NOI18N
20.8 public static final String PROJECT_CONFIGURATION_NAME = "data"; // NOI18N
20.9 public static final String PROJECT_CONFIGURATION_NAMESPACE = "http://www.netbeans.org/ns/make-project/1"; // NOI18N
20.10 public static final String PROJECT_CONFIGURATION__NAME_NAME = "name"; // NOI18N
20.11 @@ -167,6 +168,6 @@
20.12 }
20.13
20.14 private String projectLayerPath() {
20.15 - return "Projects/org-netbeans-modules-cnd-makeproject"; //NOI18N
20.16 + return "Projects/" + PROJECT_TYPE; //NOI18N
20.17 }
20.18 }
21.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/actions/AddExistingFolderItemsAction.java Tue Feb 19 16:39:13 2013 +0100
21.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/actions/AddExistingFolderItemsAction.java Wed Feb 20 15:23:50 2013 +0100
21.3 @@ -67,12 +67,23 @@
21.4 import org.openide.windows.WindowManager;
21.5
21.6 public final class AddExistingFolderItemsAction extends NodeAction {
21.7 +
21.8 + public AddExistingFolderItemsAction () {
21.9 + //TODO: uncomment when problem iwth MakeProjectLogicalViewRootNode folder will be fixed, now "Folder" can be null when it should not be null
21.10 + //putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
21.11 + }
21.12
21.13 @Override
21.14 protected boolean enable(Node[] activatedNodes) {
21.15 if (activatedNodes.length != 1) {
21.16 return false;
21.17 }
21.18 +
21.19 + Object project = activatedNodes[0].getValue("Project"); // NOI18N
21.20 + if (project == null || (!(project instanceof Project))) {
21.21 + return false;
21.22 + }
21.23 +
21.24 Folder folder = (Folder)activatedNodes[0].getValue("Folder"); // NOI18N
21.25 if (folder == null) {
21.26 return false;
21.27 @@ -209,7 +220,7 @@
21.28 @Override
21.29 public void run() {
21.30 for (SourceFolderInfo folderInfo : foldersToAdd) {
21.31 - confDescriptor.addFilesFromRoot(targetFolder, folderInfo.getFileObject(), false, Folder.Kind.SOURCE_LOGICAL_FOLDER, fileFilter);
21.32 + confDescriptor.addFilesFromRoot(targetFolder, folderInfo.getFileObject(), null, false, Folder.Kind.SOURCE_LOGICAL_FOLDER, fileFilter);
21.33 }
21.34 }
21.35 }
22.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/DefaultProjectActionHandler.java Tue Feb 19 16:39:13 2013 +0100
22.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/DefaultProjectActionHandler.java Wed Feb 20 15:23:50 2013 +0100
22.3 @@ -66,6 +66,7 @@
22.4 import org.netbeans.modules.cnd.makeproject.api.BuildActionsProvider.OutputStreamHandler;
22.5 import org.netbeans.modules.cnd.makeproject.api.ProjectActionEvent.PredefinedType;
22.6 import org.netbeans.modules.cnd.makeproject.api.ProjectActionEvent.Type;
22.7 +import org.netbeans.modules.cnd.makeproject.api.configurations.CompileConfiguration;
22.8 import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
22.9 import org.netbeans.modules.cnd.makeproject.api.runprofiles.RunProfile;
22.10 import org.netbeans.modules.cnd.makeproject.configurations.CppUtils;
22.11 @@ -237,7 +238,7 @@
22.12 }
22.13
22.14 commandLine = pae.getRunCommandAsString();
22.15 - } else { // Build or Clean
22.16 + } else { // Build or Clean or compile
22.17 // Build or Clean
22.18 cs = conf.getCompilerSet().getCompilerSet();
22.19 String csdirs = cs.getDirectory();
22.20 @@ -260,6 +261,9 @@
22.21 args = pae.getArguments();
22.22 args.add("QMAKE=" + CndPathUtilitities.escapeOddCharacters(qmakePath)); // NOI18N
22.23 }
22.24 + if (conf.isMakefileConfiguration() && !CompileConfiguration.AUTO_COMPILE.equals(conf.getCompileConfiguration().getCompileCommand().getValue())) {
22.25 + commandLine = pae.getRunCommandAsString();
22.26 + }
22.27 }
22.28
22.29 LineConvertor converter = null;
23.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/RunDialogPanel.java Tue Feb 19 16:39:13 2013 +0100
23.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/RunDialogPanel.java Wed Feb 20 15:23:50 2013 +0100
23.3 @@ -880,8 +880,8 @@
23.4 MakeConfiguration active = projectDescriptor.getActiveConfiguration();
23.5 ExecutionEnvironment executionEnvironment = FileSystemProvider.getExecutionEnvironment(fileSystem);
23.6 String baseDir = active.getBaseDir();
23.7 - MakeConfiguration conf = new MakeConfiguration(active.getBaseFSPath(),
23.8 - getConfigurationName(projectDescriptor), MakeConfiguration.TYPE_MAKEFILE, // NOI18N
23.9 + MakeConfiguration conf = MakeConfiguration.createMakefileConfiguration(active.getBaseFSPath(),
23.10 + getConfigurationName(projectDescriptor),
23.11 executionEnvironment.getHost());
23.12 // Working dir
23.13 String wd = fileSystem.findResource(getExecutablePath()).getParent().getPath();
23.14 @@ -997,7 +997,7 @@
23.15 } else {
23.16 hostID = ExecutionEnvironmentFactory.toUniqueID(ExecutionEnvironmentFactory.getLocal());
23.17 }
23.18 - MakeConfiguration conf = new MakeConfiguration(new FSPath(fileSystem, baseDir), "Default", MakeConfiguration.TYPE_MAKEFILE, hostID); // NOI18N
23.19 + MakeConfiguration conf = MakeConfiguration.createMakefileConfiguration(new FSPath(fileSystem, baseDir), "Default", hostID); // NOI18N
23.20 // Working dir
23.21 String wd = fileSystem.findResource(getExecutablePath()).getParent().getPath();
23.22 wd = CndPathUtilitities.toRelativePath(baseDir, wd);
24.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/actions/AddExistingItemAction.java Tue Feb 19 16:39:13 2013 +0100
24.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/actions/AddExistingItemAction.java Wed Feb 20 15:23:50 2013 +0100
24.3 @@ -53,7 +53,6 @@
24.4 import org.netbeans.modules.cnd.api.remote.RemoteFileUtil;
24.5 import org.netbeans.modules.cnd.utils.FileFilterFactory;
24.6 import org.netbeans.modules.cnd.makeproject.MakeSources;
24.7 -import org.netbeans.modules.cnd.makeproject.actions.BatchBuildAction;
24.8 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptor;
24.9 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
24.10 import org.netbeans.modules.cnd.makeproject.api.configurations.Folder;
24.11 @@ -76,12 +75,22 @@
24.12 public class AddExistingItemAction extends NodeAction {
24.13
24.14 private static final RequestProcessor RP = new RequestProcessor("AddExistingItemAction", 1); // NOI18N
24.15 +
24.16 + public AddExistingItemAction(){
24.17 + //TODO: uncomment when problem iwth MakeProjectLogicalViewRootNode folder will be fixed, now "Folder" can be null when it should not be null
24.18 + //putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
24.19 + }
24.20
24.21 @Override
24.22 protected boolean enable(Node[] activatedNodes) {
24.23 if (activatedNodes.length != 1) {
24.24 return false;
24.25 }
24.26 + Object project = activatedNodes[0].getValue("Project"); // NOI18N
24.27 + if (project == null || (!(project instanceof Project))) {
24.28 + return false;
24.29 + }
24.30 +
24.31 Object o = activatedNodes[0].getValue("Folder"); // NOI18N
24.32 if (!(o instanceof Folder)) {
24.33 return false;
25.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/actions/NewFolderAction.java Tue Feb 19 16:39:13 2013 +0100
25.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/actions/NewFolderAction.java Wed Feb 20 15:23:50 2013 +0100
25.3 @@ -57,6 +57,13 @@
25.4 import org.openide.util.actions.NodeAction;
25.5
25.6 public class NewFolderAction extends NodeAction {
25.7 +
25.8 +
25.9 + public NewFolderAction() {
25.10 + //TODO: uncomment when problem iwth MakeProjectLogicalViewRootNode folder will be fixed, now "Folder" can be null when it should not be null
25.11 + //putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
25.12 + }
25.13 +
25.14 public String getName() {
25.15 return NbBundle.getBundle(getClass()).getString("CTL_NewFolderAction"); // NOI18N
25.16 }
25.17 @@ -93,11 +100,18 @@
25.18 }
25.19
25.20 public boolean enable(Node[] activatedNodes) {
25.21 - if (activatedNodes.length != 1)
25.22 + if (activatedNodes.length != 1) {
25.23 return false;
25.24 + }
25.25 + Object project = activatedNodes[0].getValue("Project"); // NOI18N
25.26 + if (project == null || (!(project instanceof Project))) {
25.27 + return false;
25.28 + }
25.29 +
25.30 Folder folder = (Folder)activatedNodes[0].getValue("Folder"); // NOI18N
25.31 - if (folder == null)
25.32 + if (folder == null) {
25.33 return false;
25.34 + }
25.35 // if (!folder.isProjectFiles())
25.36 // return false;
25.37 return true;
26.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/Bundle.properties Tue Feb 19 16:39:13 2013 +0100
26.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/Bundle.properties Wed Feb 20 15:23:50 2013 +0100
26.3 @@ -245,6 +245,16 @@
26.4 MakefileTxt=Makefile
26.5 MakefileHint=Makefile
26.6
26.7 +#Compile Configuration
26.8 +CompileTxt=Compile File
26.9 +CompileHint=Compile single file command.
26.10 +CompileWorkingDirectory_LBL=Compile Working Directory
26.11 +CompileWorkingDirectory_TT=The directory in which the compile command is executed.<br>If the directory exactly equals "${AUTO_FOLDER}", the IDE will automatically count folder.
26.12 +CompileCommandLine_LBL=Compile Command
26.13 +CompileCommandLine_TT=The command that compiles a single file.<br>If the compile command exactly equals "${AUTO_COMPILE}", the IDE will automatically create command.\
26.14 + <br>The macros "${ITEM_PATH}" will be substituted by absolute file path.\
26.15 + <br>The macros "${ITEM_NAME}" will be substituted by file name without extension.
26.16 +
26.17 # MakeConfigurationDescriptor
26.18 SourceFilesTxt=Source Files
26.19 HeaderFilesTxt=Header Files
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/CompileConfiguration.java Wed Feb 20 15:23:50 2013 +0100
27.3 @@ -0,0 +1,133 @@
27.4 +/*
27.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
27.6 + *
27.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
27.8 + *
27.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
27.10 + * Other names may be trademarks of their respective owners.
27.11 + *
27.12 + * The contents of this file are subject to the terms of either the GNU
27.13 + * General Public License Version 2 only ("GPL") or the Common
27.14 + * Development and Distribution License("CDDL") (collectively, the
27.15 + * "License"). You may not use this file except in compliance with the
27.16 + * License. You can obtain a copy of the License at
27.17 + * http://www.netbeans.org/cddl-gplv2.html
27.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
27.19 + * specific language governing permissions and limitations under the
27.20 + * License. When distributing the software, include this License Header
27.21 + * Notice in each file and include the License file at
27.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
27.23 + * particular file as subject to the "Classpath" exception as provided
27.24 + * by Oracle in the GPL Version 2 section of the License file that
27.25 + * accompanied this code. If applicable, add the following below the
27.26 + * License Header, with the fields enclosed by brackets [] replaced by
27.27 + * your own identifying information:
27.28 + * "Portions Copyrighted [year] [name of copyright owner]"
27.29 + *
27.30 + * If you wish your version of this file to be governed by only the CDDL
27.31 + * or only the GPL Version 2, indicate your decision by adding
27.32 + * "[Contributor] elects to include this software in this distribution
27.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
27.34 + * single choice of license, a recipient has the option to distribute
27.35 + * your version of this file under either the CDDL, the GPL Version 2 or
27.36 + * to extend the choice of license to its licensees as provided above.
27.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
27.38 + * Version 2 license, then the option applies only if the new code is
27.39 + * made subject to such option by the copyright holder.
27.40 + *
27.41 + * Contributor(s):
27.42 + *
27.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
27.44 + */
27.45 +package org.netbeans.modules.cnd.makeproject.api.configurations;
27.46 +
27.47 +import org.netbeans.modules.cnd.api.picklist.DefaultPicklistModel;
27.48 +import org.netbeans.modules.cnd.makeproject.api.configurations.ui.ComboStringNodeProp;
27.49 +import org.openide.nodes.Sheet;
27.50 +import org.openide.util.NbBundle;
27.51 +
27.52 +/**
27.53 + *
27.54 + * @author Alexander Simon
27.55 + */
27.56 +public class CompileConfiguration implements Cloneable {
27.57 + private MakeConfiguration makeConfiguration;
27.58 + private ComboStringConfiguration compileCommandWorkingDir;
27.59 + private DefaultPicklistModel compileCommandWorkingDirPicklist;
27.60 + private ComboStringConfiguration compileCommand;
27.61 + private DefaultPicklistModel compileCommandPicklist;
27.62 + public static final String AUTO_FOLDER = "${AUTO_FOLDER}"; // NOI18N
27.63 + public static final String AUTO_COMPILE = "${AUTO_COMPILE}"; // NOI18N
27.64 + public static final String AUTO_MAKE = "${MAKE}"; // NOI18N
27.65 + public static final String AUTO_ITEM_PATH = "${ITEM_PATH}"; // NOI18N
27.66 + public static final String AUTO_ITEM_NAME = "${ITEM_NAME}"; // NOI18N
27.67 +
27.68 + public CompileConfiguration(MakeConfiguration makeConfiguration) {
27.69 + this.makeConfiguration = makeConfiguration;
27.70 +
27.71 + compileCommandWorkingDirPicklist = new DefaultPicklistModel(10);
27.72 + compileCommandWorkingDirPicklist.addElement(AUTO_FOLDER);
27.73 + compileCommandWorkingDirPicklist.addElement("."); // NOI18N
27.74 + compileCommandWorkingDir = new ComboStringConfiguration(null, AUTO_FOLDER, compileCommandWorkingDirPicklist);
27.75 +
27.76 + compileCommandPicklist = new DefaultPicklistModel(10);
27.77 + compileCommandPicklist.addElement(AUTO_COMPILE);
27.78 + compileCommandPicklist.addElement("${MAKE} ${ITEM_NAME}.o"); // NOI18N
27.79 + compileCommand = new ComboStringConfiguration(null, AUTO_COMPILE, compileCommandPicklist); // NOI18N
27.80 + }
27.81 +
27.82 + public Sheet getSheet() {
27.83 + Sheet sheet = new Sheet();
27.84 +
27.85 + Sheet.Set set = new Sheet.Set();
27.86 + set.setName("Compile"); // NOI18N
27.87 + set.setDisplayName(getString("CompileTxt")); // NOI18N
27.88 + set.setShortDescription(getString("CompileHint")); // NOI18N
27.89 + set.put(new ComboStringNodeProp(getCompileCommandWorkingDir(), true, getString("CompileWorkingDirectory_LBL"), getString("CompileWorkingDirectory_TT"))); // NOI18N
27.90 + set.put(new ComboStringNodeProp(getCompileCommand(), true, getString("CompileCommandLine_LBL"), getString("CompileCommandLine_TT"))); // NOI18N
27.91 + sheet.put(set);
27.92 +
27.93 + return sheet;
27.94 + }
27.95 +
27.96 + public ComboStringConfiguration getCompileCommandWorkingDir() {
27.97 + return compileCommandWorkingDir;
27.98 + }
27.99 +
27.100 + public void setCompileCommandWorkingDir(ComboStringConfiguration compileCommandWorkingDir) {
27.101 + this.compileCommandWorkingDir = compileCommandWorkingDir;
27.102 + }
27.103 +
27.104 + public ComboStringConfiguration getCompileCommand() {
27.105 + return compileCommand;
27.106 + }
27.107 +
27.108 + public void setCompileCommand(ComboStringConfiguration compileCommand) {
27.109 + this.compileCommand = compileCommand;
27.110 + }
27.111 +
27.112 + private String getString(String key) {
27.113 + return NbBundle.getMessage(CompileConfiguration.class, key);
27.114 + }
27.115 +
27.116 + public MakeConfiguration getMakeConfiguration() {
27.117 + return makeConfiguration;
27.118 + }
27.119 +
27.120 + public void setMakeConfiguration(MakeConfiguration makeConfiguration) {
27.121 + this.makeConfiguration = makeConfiguration;
27.122 + }
27.123 +
27.124 + @Override
27.125 + public CompileConfiguration clone() {
27.126 + CompileConfiguration clone = new CompileConfiguration(getMakeConfiguration());
27.127 + clone.setCompileCommandWorkingDir(getCompileCommandWorkingDir().clone());
27.128 + clone.setCompileCommand(getCompileCommand().clone());
27.129 + return clone;
27.130 + }
27.131 +
27.132 + void assign(CompileConfiguration compileConfiguration) {
27.133 + getCompileCommandWorkingDir().assign(compileConfiguration.getCompileCommandWorkingDir());
27.134 + getCompileCommand().assign(compileConfiguration.getCompileCommand());
27.135 + }
27.136 +}
28.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/ConfigurationDescriptor.java Tue Feb 19 16:39:13 2013 +0100
28.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/ConfigurationDescriptor.java Wed Feb 20 15:23:50 2013 +0100
28.3 @@ -97,7 +97,7 @@
28.4
28.5 public abstract String getBaseDir();
28.6
28.7 - public abstract Configuration defaultConf(String name, int type);
28.8 + public abstract Configuration defaultConf(String name, int type, String cutomizerId);
28.9
28.10 public abstract void copyFromProjectDescriptor(ConfigurationDescriptor projectDescriptor);
28.11
29.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/MakeConfiguration.java Tue Feb 19 16:39:13 2013 +0100
29.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/MakeConfiguration.java Wed Feb 20 15:23:50 2013 +0100
29.3 @@ -87,7 +87,7 @@
29.4 import org.openide.util.Lookup;
29.5 import org.openide.util.NbBundle;
29.6
29.7 -public class MakeConfiguration extends Configuration implements Cloneable {
29.8 +public final class MakeConfiguration extends Configuration implements Cloneable {
29.9
29.10 public static final String NBPROJECT_FOLDER = "nbproject"; // NOI18N
29.11 public static final String NBPROJECT_PRIVATE_FOLDER = "nbproject/private"; // NOI18N
29.12 @@ -139,6 +139,7 @@
29.13 // Configurations
29.14 private IntConfiguration configurationType;
29.15 private MakefileConfiguration makefileConfiguration;
29.16 + private CompileConfiguration compileConfiguration;
29.17 private CompilerSet2Configuration compilerSet;
29.18 private LanguageBooleanConfiguration cRequired;
29.19 private LanguageBooleanConfiguration cppRequired;
29.20 @@ -165,37 +166,37 @@
29.21
29.22 private String customizerId = null;
29.23
29.24 - //XXX:fullRemote:fileSystem - should be removed (replaced with FSPath)
29.25 - public MakeConfiguration(String baseDir, String name, int configurationTypeValue) {
29.26 - this(baseDir, name, configurationTypeValue, null);
29.27 - }
29.28 -
29.29 - //XXX:fullRemote:fileSystem - should be removed (replaced with FSPath)
29.30 - public MakeConfiguration(String baseDir, String name, int configurationTypeValue, String hostUID) {
29.31 - this(baseDir, name, configurationTypeValue, hostUID, null, true);
29.32 - }
29.33 -
29.34 - public MakeConfiguration(String baseDir, String name, int configurationTypeValue, String hostUID, CompilerSet hostCS, boolean defaultToolCollection) {
29.35 - this(new FSPath(CndFileUtils.getLocalFileSystem(), baseDir), name, configurationTypeValue, null, hostUID, hostCS, defaultToolCollection);
29.36 - }
29.37 +// //XXX:fullRemote:fileSystem - should be removed (replaced with FSPath)
29.38 +// public MakeConfiguration(String baseDir, String name, int configurationTypeValue) {
29.39 +// this(baseDir, name, configurationTypeValue, null);
29.40 +// }
29.41 +//
29.42 +// //XXX:fullRemote:fileSystem - should be removed (replaced with FSPath)
29.43 +// public MakeConfiguration(String baseDir, String name, int configurationTypeValue, String hostUID) {
29.44 +// this(baseDir, name, configurationTypeValue, hostUID, null, true);
29.45 +// }
29.46 +//
29.47 +// public MakeConfiguration(String baseDir, String name, int configurationTypeValue, String hostUID, CompilerSet hostCS, boolean defaultToolCollection) {
29.48 +// this(new FSPath(CndFileUtils.getLocalFileSystem(), baseDir), name, configurationTypeValue, null, hostUID, hostCS, defaultToolCollection);
29.49 +// }
29.50 +//
29.51 +// public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue) {
29.52 +// this(fsPath, name, configurationTypeValue, null);
29.53 +// }
29.54 +//
29.55 +// public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String hostUID) {
29.56 +// this(fsPath, name, configurationTypeValue, null, hostUID, null, true);
29.57 +// }
29.58
29.59 - public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue) {
29.60 - this(fsPath, name, configurationTypeValue, null);
29.61 - }
29.62 -
29.63 - public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String hostUID) {
29.64 - this(fsPath, name, configurationTypeValue, null, hostUID, null, true);
29.65 - }
29.66 -
29.67 - public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String customizerId, String hostUID) {
29.68 + private MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String customizerId, String hostUID) {
29.69 this(fsPath, name, configurationTypeValue, customizerId, hostUID, null, true);
29.70 }
29.71 - public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String hostUID, CompilerSet hostCS, boolean defaultToolCollection) {
29.72 + private MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String hostUID, CompilerSet hostCS, boolean defaultToolCollection) {
29.73 this(fsPath, name, configurationTypeValue, null, hostUID, hostCS, defaultToolCollection);
29.74 }
29.75
29.76
29.77 - public MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String customizerId, String hostUID, CompilerSet hostCS, boolean defaultToolCollection) {
29.78 + private MakeConfiguration(FSPath fsPath, String name, int configurationTypeValue, String customizerId, String hostUID, CompilerSet hostCS, boolean defaultToolCollection) {
29.79 super(fsPath, name);
29.80 remoteMode = RemoteProject.DEFAULT_MODE;
29.81 hostUID = (hostUID == null) ? CppUtils.getDefaultDevelopmentHost() : hostUID;
29.82 @@ -225,6 +226,7 @@
29.83 fortranRequired = new LanguageBooleanConfiguration();
29.84 assemblerRequired = new LanguageBooleanConfiguration();
29.85 makefileConfiguration = new MakefileConfiguration(this);
29.86 + compileConfiguration = new CompileConfiguration(this);
29.87 dependencyChecking = new BooleanConfiguration(isMakefileConfiguration() ? false : MakeProjectOptions.getDepencyChecking());
29.88 rebuildPropChanged = new BooleanConfiguration(isMakefileConfiguration() ? false : MakeProjectOptions.getRebuildPropChanged());
29.89 cCompilerConfiguration = new CCompilerConfiguration(fsPath.getPath(), null, this); //XXX:fullRemote:fileSystem - use FSPath
29.90 @@ -243,6 +245,37 @@
29.91 codeAssistanceConfiguration = new CodeAssistanceConfiguration(this);
29.92 initAuxObjects();
29.93 }
29.94 +
29.95 + /**
29.96 + * Will create the configuration of type MakeConfiguration.TYPE_MAKEFILE, the configuration will be saved on the local machine
29.97 + * and will be created for default Build Host, which is returned by {@link #org.netbeans.modules.cnd.makeproject.configurations.CppUtils.getDefaultDevelopmentHost()} method
29.98 + * For full remote project should use {@link #createMakefileConfiguration(FSPath, String, String)}
29.99 + * @param baseDir path to the folder the configuration will be saved in
29.100 + * @param name the name of the configuration
29.101 + * @return the MakeConfiguration
29.102 + */
29.103 + public static MakeConfiguration createDefaultHostMakefileConfiguration(String baseDir, String name) {
29.104 + return new MakeConfiguration(new FSPath(CndFileUtils.getLocalFileSystem(), baseDir), name, MakeConfiguration.TYPE_MAKEFILE, null, null);
29.105 + }
29.106 +
29.107 + public static MakeConfiguration createMakefileConfiguration(FSPath baseDir, String name, String hostID) {
29.108 + return new MakeConfiguration(baseDir, name, MakeConfiguration.TYPE_MAKEFILE, null, hostID);
29.109 + }
29.110 +
29.111 + public static MakeConfiguration createMakefileConfiguration(FSPath baseDir, String name, String hostID, CompilerSet hostCS, boolean defaultToolCollection) {
29.112 + return new MakeConfiguration(baseDir, name, MakeConfiguration.TYPE_MAKEFILE, null, hostID, hostCS, defaultToolCollection);
29.113 + }
29.114 +
29.115 +
29.116 + public static MakeConfiguration createConfiguration(FSPath baseDir, String name, int configurationType, String customizerID, String hostID) {
29.117 + return new MakeConfiguration(baseDir, name, configurationType, customizerID, hostID);
29.118 + }
29.119 +
29.120 + public static MakeConfiguration createConfiguration(FSPath baseDir, String name,
29.121 + int configurationType, String customizerID, String hostID, CompilerSet hostCS, boolean defaultToolCollection) {
29.122 + return new MakeConfiguration(baseDir,
29.123 + name, configurationType, customizerID, hostID, hostCS, defaultToolCollection);
29.124 + }
29.125
29.126 public void setMakefileConfiguration(MakefileConfiguration makefileConfiguration) {
29.127 this.makefileConfiguration = makefileConfiguration;
29.128 @@ -253,6 +286,15 @@
29.129 return makefileConfiguration;
29.130 }
29.131
29.132 + public void setCompileConfiguration(CompileConfiguration compileConfiguration) {
29.133 + this.compileConfiguration = compileConfiguration;
29.134 + this.compileConfiguration.setMakeConfiguration(this);
29.135 + }
29.136 +
29.137 + public CompileConfiguration getCompileConfiguration() {
29.138 + return compileConfiguration;
29.139 + }
29.140 +
29.141 public IntConfiguration getConfigurationType() {
29.142 return configurationType;
29.143 }
29.144 @@ -555,6 +597,7 @@
29.145 getRebuildPropChanged().assign(makeConf.getRebuildPropChanged());
29.146
29.147 getMakefileConfiguration().assign(makeConf.getMakefileConfiguration());
29.148 + getCompileConfiguration().assign(makeConf.getCompileConfiguration());
29.149 getCCompilerConfiguration().assign(makeConf.getCCompilerConfiguration());
29.150 getCCompilerConfiguration().setOwner(makeConf);
29.151 getCCCompilerConfiguration().assign(makeConf.getCCCompilerConfiguration());
29.152 @@ -596,7 +639,9 @@
29.153 */
29.154 @Override
29.155 public Configuration copy() {
29.156 - MakeConfiguration copy = new MakeConfiguration(getBaseFSPath(), getName(), getConfigurationType().getValue());
29.157 + MakeConfiguration copy =
29.158 + MakeConfiguration.createConfiguration(getBaseFSPath(), getName(), getConfigurationType().getValue(),
29.159 + getCustomizerId(), ExecutionEnvironmentFactory.toUniqueID(developmentHost.getExecutionEnvironment()));
29.160 copy.assign(this);
29.161 // copy aux objects
29.162 ConfigurationAuxObject[] auxs = getAuxObjects();
29.163 @@ -700,6 +745,7 @@
29.164 clone.setFortranRequired(getFortranRequired().clone());
29.165 clone.setAssemblerRequired(getAssemblerRequired().clone());
29.166 clone.setMakefileConfiguration(getMakefileConfiguration().clone());
29.167 + clone.setCompileConfiguration(getCompileConfiguration().clone());
29.168 clone.setDependencyChecking(getDependencyChecking().clone());
29.169 clone.setRebuildPropChanged(getRebuildPropChanged().clone());
29.170 clone.setCCompilerConfiguration(getCCompilerConfiguration().clone());
29.171 @@ -951,7 +997,7 @@
29.172 public void setCodeAssistanceConfiguration(CodeAssistanceConfiguration codeAssistanceConfiguration) {
29.173 this.codeAssistanceConfiguration = codeAssistanceConfiguration;
29.174 }
29.175 -
29.176 +
29.177 public class LanguageBooleanConfiguration extends BooleanConfiguration implements Cloneable {
29.178
29.179 private boolean notYetSet = true;
30.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/MakeConfigurationDescriptor.java Tue Feb 19 16:39:13 2013 +0100
30.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/MakeConfigurationDescriptor.java Wed Feb 20 15:23:50 2013 +0100
30.3 @@ -50,7 +50,6 @@
30.4 import java.util.Collections;
30.5 import java.util.HashSet;
30.6 import java.util.Iterator;
30.7 -import java.util.LinkedList;
30.8 import java.util.List;
30.9 import java.util.Map;
30.10 import java.util.Map.Entry;
30.11 @@ -387,7 +386,7 @@
30.12 if (sourceFileFolders != null) {
30.13 while (sourceFileFolders.hasNext()) {
30.14 SourceFolderInfo sourceFolderInfo = sourceFileFolders.next();
30.15 - addFilesFromRoot(getLogicalFolders(), sourceFolderInfo.getFileObject(), false, Folder.Kind.SOURCE_DISK_FOLDER, null);
30.16 + addFilesFromRoot(getLogicalFolders(), sourceFolderInfo.getFileObject(), null, false, Folder.Kind.SOURCE_DISK_FOLDER, null);
30.17 }
30.18 }
30.19 setModified();
30.20 @@ -513,7 +512,7 @@
30.21 }
30.22
30.23 @Override
30.24 - public Configuration defaultConf(String name, int type) {
30.25 + public Configuration defaultConf(String name, int type, String customizerId) {
30.26 String defaultHost = CppUtils.getDefaultDevelopmentHost();
30.27 Project proj = getProject();
30.28 if (proj != null) {
30.29 @@ -523,7 +522,7 @@
30.30 }
30.31 }
30.32
30.33 - MakeConfiguration c = new MakeConfiguration(FSPath.toFSPath(baseDirFO), name, type, defaultHost);
30.34 + MakeConfiguration c = MakeConfiguration.createConfiguration(FSPath.toFSPath(baseDirFO), name, type, customizerId, defaultHost);
30.35 Item[] items = getProjectItems();
30.36 for (int i = 0; i < items.length; i++) {
30.37 c.addAuxObject(new ItemConfiguration(c, items[i]));
30.38 @@ -1636,7 +1635,7 @@
30.39 if (toBeAdded.size() > 0) {
30.40 for (String root : toBeAdded) {
30.41 FileObject fo = RemoteFileUtil.getFileObject(baseDirFO, root);
30.42 - addFilesFromRoot(getLogicalFolders(), fo, true, Folder.Kind.SOURCE_DISK_FOLDER, null);
30.43 + addFilesFromRoot(getLogicalFolders(), fo, null, true, Folder.Kind.SOURCE_DISK_FOLDER, null);
30.44 }
30.45 setModified();
30.46 }
30.47 @@ -1792,7 +1791,8 @@
30.48 }
30.49 }
30.50
30.51 - public void addFilesFromRoot(Folder folder, FileObject dir, boolean attachListeners, Folder.Kind folderKind, @NullAllowed FileObjectFilter fileFilter) {
30.52 + public void addFilesFromRoot(Folder folder, FileObject dir, ProgressHandle handle,
30.53 + boolean attachListeners, Folder.Kind folderKind, @NullAllowed FileObjectFilter fileFilter) {
30.54 CndUtils.assertTrueInConsole(folder != null, "null folder"); //NOI18N
30.55 CndUtils.assertTrueInConsole(dir != null, "null directory"); //NOI18N
30.56 if (folder == null || dir == null || !dir.isValid()) {
30.57 @@ -1814,7 +1814,7 @@
30.58 srcRoot = folder.addFolder(srcRoot, true);
30.59 }
30.60 assert srcRoot.getKind() == folderKind;
30.61 - addFilesImpl(new LinkedList<String>(), srcRoot, dir, null, filesAdded, true, true, fileFilter, true/*all found are included by default*/);
30.62 + addFilesImpl(srcRoot, dir, handle, filesAdded, true, true, fileFilter, true/*all found are included by default*/);
30.63 if (getNativeProjectChangeSupport() != null) { // once not null, it never becomes null
30.64 getNativeProjectChangeSupport().fireFilesAdded(filesAdded);
30.65 }
30.66 @@ -1826,21 +1826,23 @@
30.67 }
30.68
30.69 public Folder addFilesFromRefreshedDir(Folder folder, FileObject dir, boolean attachListeners, boolean setModified, @NullAllowed FileObjectFilter fileFilter, boolean useOldSchemeBehavior) {
30.70 - return addFilesFromDirImpl(folder, dir, attachListeners, setModified, fileFilter, useOldSchemeBehavior);
30.71 + return addFilesFromDirImpl(folder, dir, null, attachListeners, setModified, fileFilter, useOldSchemeBehavior);
30.72 }
30.73
30.74 public Folder addFilesFromDir(Folder folder, FileObject dir, boolean attachListeners, boolean setModified, @NullAllowed FileObjectFilter fileFilter) {
30.75 - return addFilesFromDirImpl(folder, dir, attachListeners, setModified, fileFilter, false);
30.76 + return addFilesFromDirImpl(folder, dir, null, attachListeners, setModified, fileFilter, false);
30.77 }
30.78
30.79 - private Folder addFilesFromDirImpl(Folder folder, FileObject dir, boolean attachListeners, boolean setModified, @NullAllowed FileObjectFilter fileFilter, boolean useOldSchemeBehavior) {
30.80 + private Folder addFilesFromDirImpl(Folder folder, FileObject dir, ProgressHandle handle,
30.81 + boolean attachListeners, boolean setModified, @NullAllowed
30.82 + FileObjectFilter fileFilter, boolean useOldSchemeBehavior) {
30.83 ArrayList<NativeFileItem> filesAdded = new ArrayList<NativeFileItem>();
30.84 Folder subFolder = folder.findFolderByName(dir.getNameExt());
30.85 if (subFolder == null) {
30.86 subFolder = new Folder(folder.getConfigurationDescriptor(), folder, dir.getNameExt(), dir.getNameExt(), true, null);
30.87 }
30.88 subFolder = folder.addFolder(subFolder, setModified);
30.89 - addFilesImpl(new LinkedList<String>(), subFolder, dir, null, filesAdded, true, setModified, fileFilter, useOldSchemeBehavior);
30.90 + addFilesImpl(subFolder, dir, null, filesAdded, true, setModified, fileFilter, useOldSchemeBehavior);
30.91 if (getNativeProjectChangeSupport() != null) { // once not null, it never becomes null
30.92 getNativeProjectChangeSupport().fireFilesAdded(filesAdded);
30.93 }
30.94 @@ -1850,96 +1852,105 @@
30.95 return subFolder;
30.96 }
30.97
30.98 - private void addFilesImpl(LinkedList<String> antiLoop, Folder folder, FileObject dir, ProgressHandle handle, ArrayList<NativeFileItem> filesAdded, boolean notify, boolean setModified, @NullAllowed
30.99 - final FileObjectFilter fileFilter, boolean useOldSchemeBehavior) {
30.100 + private void addFilesImpl(final Folder aFolder, final FileObject aDir, final ProgressHandle handle,
30.101 + final ArrayList<NativeFileItem> filesAdded, final boolean notify, final boolean setModified,
30.102 + @NullAllowed final FileObjectFilter fileFilter, final boolean useOldSchemeBehavior) {
30.103 List<String> absTestRootsList = getAbsoluteTestRoots();
30.104 + List<AntiLoop> down = new ArrayList<AntiLoop>();
30.105 + String canPath;
30.106 try {
30.107 - String canPath = RemoteFileUtil.getCanonicalPath(dir);
30.108 - if (antiLoop.contains(canPath)) {
30.109 - // It seems we have recursive link
30.110 - LOGGER.log(Level.INFO, "Ignore recursive link {0} in folder {1}", new Object[]{canPath, folder.getPath()});
30.111 - return;
30.112 - }
30.113 - antiLoop.addLast(canPath);
30.114 + canPath = RemoteFileUtil.getCanonicalPath(aDir);
30.115 } catch (IOException ex) {
30.116 - LOGGER.log(Level.INFO, ex.getMessage(), ex);
30.117 return;
30.118 }
30.119 -
30.120 - PerformanceLogger.PerformaceAction lsPerformanceEvent = PerformanceLogger.getLogger().start(Folder.LS_FOLDER_PERFORMANCE_EVENT, dir);
30.121 - FileObject[] files = null;
30.122 - try {
30.123 - lsPerformanceEvent.setTimeOut(Folder.FS_TIME_OUT);
30.124 - files = dir.getChildren();
30.125 - if (files == null) {
30.126 - antiLoop.removeLast();
30.127 - return;
30.128 - }
30.129 - } finally {
30.130 - lsPerformanceEvent.log(files== null ? 0 : files.length);
30.131 - }
30.132 -
30.133 - final boolean hideBinaryFiles = !MakeOptions.getInstance().getViewBinaryFiles();
30.134 - for (FileObject file : files) {
30.135 - if (!VisibilityQuery.getDefault().isVisible(file)) {
30.136 - continue;
30.137 - }
30.138 - if (fileFilter != null && !fileFilter.accept(file)) {
30.139 - continue;
30.140 - }
30.141 - if (hideBinaryFiles && CndFileVisibilityQuery.getDefault().isIgnored(file.getNameExt())) {
30.142 - continue;
30.143 - }
30.144 - if (file.isData() && folder.isDiskFolder() && !CndFileVisibilityQuery.getDefault().isVisible(file)) {
30.145 - // be consistent in checks to prevent adding item here followed
30.146 - // by remove in Folder.refreshDiskFolder due to !CndFileVisibilityQuery.getDefault().isIgnored(file)
30.147 - continue;
30.148 - }
30.149 - if (file.isFolder() && getFolderVisibilityQuery().isIgnored(file)) {
30.150 - continue;
30.151 - }
30.152 - if (file.isFolder()) {
30.153 + AntiLoop antiLoop = new AntiLoop(aFolder, aDir, null);
30.154 + antiLoop.push(canPath);
30.155 + down.add(antiLoop);
30.156 + while (!down.isEmpty()) {
30.157 + List<AntiLoop> next = new ArrayList<AntiLoop>();
30.158 + for (AntiLoop loop : down) {
30.159 + FileObject dir = loop.getFile();
30.160 + Folder folder = loop.getFolder();
30.161 + if (handle != null) {
30.162 + handle.progress("("+filesAdded.size()+") "+dir.getPath()); //NOI18N
30.163 + }
30.164 + PerformanceLogger.PerformaceAction lsPerformanceEvent = PerformanceLogger.getLogger().start(Folder.LS_FOLDER_PERFORMANCE_EVENT, dir);
30.165 + FileObject[] files = null;
30.166 try {
30.167 - String canPath = RemoteFileUtil.getCanonicalPath(file);
30.168 - if (antiLoop.contains(canPath)) {
30.169 - // It seems we have recursive link
30.170 - LOGGER.log(Level.INFO, "Ignore recursive link {0} in folder {1}", new Object[]{canPath, folder.getPath()});
30.171 + lsPerformanceEvent.setTimeOut(Folder.FS_TIME_OUT);
30.172 + files = dir.getChildren();
30.173 + if (files == null) {
30.174 continue;
30.175 }
30.176 - } catch (IOException ex) {
30.177 - LOGGER.log(Level.INFO, ex.getMessage(), ex);
30.178 - continue;
30.179 + } finally {
30.180 + lsPerformanceEvent.log(files == null ? 0 : files.length);
30.181 }
30.182 - Folder dirfolder = folder.findFolderByName(file.getNameExt());
30.183 - if (dirfolder == null) {
30.184 - // child folder inherits kind of parent folder
30.185 - if (inList(absTestRootsList, RemoteFileUtil.getAbsolutePath(file)) || folder.isTestLogicalFolder()) {
30.186 - dirfolder = folder.addNewFolder(file.getNameExt(), file.getNameExt(), true, Folder.Kind.TEST_LOGICAL_FOLDER);
30.187 +
30.188 + final boolean hideBinaryFiles = !MakeOptions.getInstance().getViewBinaryFiles();
30.189 + for (FileObject file : files) {
30.190 + if (!VisibilityQuery.getDefault().isVisible(file)) {
30.191 + continue;
30.192 + }
30.193 + if (fileFilter != null && !fileFilter.accept(file)) {
30.194 + continue;
30.195 + }
30.196 + if (hideBinaryFiles && CndFileVisibilityQuery.getDefault().isIgnored(file.getNameExt())) {
30.197 + continue;
30.198 + }
30.199 + if (file.isData() && folder.isDiskFolder() && !CndFileVisibilityQuery.getDefault().isVisible(file)) {
30.200 + // be consistent in checks to prevent adding item here followed
30.201 + // by remove in Folder.refreshDiskFolder due to !CndFileVisibilityQuery.getDefault().isIgnored(file)
30.202 + continue;
30.203 + }
30.204 + if (file.isFolder() && getFolderVisibilityQuery().isIgnored(file)) {
30.205 + continue;
30.206 + }
30.207 + if (handle != null) {
30.208 + handle.progress("("+filesAdded.size()+") "+file.getPath()); //NOI18N
30.209 + }
30.210 + if (file.isFolder()) {
30.211 + try {
30.212 + canPath = RemoteFileUtil.getCanonicalPath(file);
30.213 + if (loop.contains(canPath)) {
30.214 + // It seems we have recursive link
30.215 + LOGGER.log(Level.INFO, "Ignore recursive link {0} in folder {1}", new Object[]{canPath, folder.getPath()});
30.216 + continue;
30.217 + }
30.218 + } catch (IOException ex) {
30.219 + LOGGER.log(Level.INFO, ex.getMessage(), ex);
30.220 + continue;
30.221 + }
30.222 + Folder dirfolder = folder.findFolderByName(file.getNameExt());
30.223 + if (dirfolder == null) {
30.224 + // child folder inherits kind of parent folder
30.225 + if (inList(absTestRootsList, RemoteFileUtil.getAbsolutePath(file)) || folder.isTestLogicalFolder()) {
30.226 + dirfolder = folder.addNewFolder(file.getNameExt(), file.getNameExt(), true, Folder.Kind.TEST_LOGICAL_FOLDER);
30.227 + } else {
30.228 + dirfolder = folder.addNewFolder(file.getNameExt(), file.getNameExt(), true, (Folder.Kind) null);
30.229 + }
30.230 + }
30.231 + dirfolder.markRemoved(false);
30.232 + antiLoop = new AntiLoop(dirfolder, file, loop);
30.233 + antiLoop.push(canPath);
30.234 + next.add(antiLoop);
30.235 } else {
30.236 - dirfolder = folder.addNewFolder(file.getNameExt(), file.getNameExt(), true, (Folder.Kind)null);
30.237 + PerformanceLogger.PerformaceAction performanceEvent = PerformanceLogger.getLogger().start(Folder.CREATE_ITEM_PERFORMANCE_EVENT, file);
30.238 + Item item = null;
30.239 + try {
30.240 + performanceEvent.setTimeOut(Folder.FS_TIME_OUT);
30.241 + String path = ProjectSupport.toProperPath(baseDirFO, file, project);
30.242 + item = Item.createInBaseDir(baseDirFO, path);
30.243 + if (folder.addItemFromRefreshDir(item, notify, setModified, useOldSchemeBehavior) == item) {
30.244 + filesAdded.add(item);
30.245 + }
30.246 + } finally {
30.247 + performanceEvent.log(item);
30.248 + }
30.249 }
30.250 }
30.251 - dirfolder.markRemoved(false);
30.252 - addFilesImpl(antiLoop, dirfolder, file, handle, filesAdded, notify, setModified, fileFilter, useOldSchemeBehavior);
30.253 - } else {
30.254 - PerformanceLogger.PerformaceAction performanceEvent = PerformanceLogger.getLogger().start(Folder.CREATE_ITEM_PERFORMANCE_EVENT, file);
30.255 - Item item = null;
30.256 - try {
30.257 - performanceEvent.setTimeOut(Folder.FS_TIME_OUT);
30.258 - String path = ProjectSupport.toProperPath(baseDirFO, file, project);
30.259 - item = Item.createInBaseDir(baseDirFO, path);
30.260 - if (folder.addItemFromRefreshDir(item, notify, setModified, useOldSchemeBehavior) == item) {
30.261 - filesAdded.add(item);
30.262 - }
30.263 - } finally {
30.264 - performanceEvent.log(item);
30.265 - }
30.266 - if (handle != null) {
30.267 - handle.progress(item.getPath());
30.268 - }
30.269 }
30.270 + down = next;
30.271 }
30.272 - antiLoop.removeLast();
30.273 }
30.274
30.275 public boolean okToChange() {
30.276 @@ -1982,4 +1993,29 @@
30.277 private static String getString(String s, String a1) {
30.278 return NbBundle.getMessage(MakeConfigurationDescriptor.class, s, a1);
30.279 }
30.280 +
30.281 + static class AntiLoop {
30.282 + private final Folder currentFolder;
30.283 + private final FileObject currentFile;
30.284 + private final List<String> antiLoop = new ArrayList<String>();
30.285 + AntiLoop(Folder folder, FileObject file, AntiLoop prev){
30.286 + if (prev != null) {
30.287 + antiLoop.addAll(prev.antiLoop);
30.288 + }
30.289 + this.currentFolder = folder;
30.290 + this.currentFile = file;
30.291 + }
30.292 + boolean contains(String canonicalPath) {
30.293 + return antiLoop.contains(canonicalPath);
30.294 + }
30.295 + void push(String canonicalPath) {
30.296 + antiLoop.add(canonicalPath);
30.297 + }
30.298 + Folder getFolder() {
30.299 + return currentFolder;
30.300 + }
30.301 + FileObject getFile() {
30.302 + return currentFile;
30.303 + }
30.304 + }
30.305 }
31.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/AuxConfigurationXMLCodec.java Tue Feb 19 16:39:13 2013 +0100
31.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/AuxConfigurationXMLCodec.java Wed Feb 20 15:23:50 2013 +0100
31.3 @@ -45,15 +45,18 @@
31.4
31.5 import java.util.ArrayList;
31.6 import java.util.List;
31.7 +import org.netbeans.modules.cnd.api.picklist.PicklistElement;
31.8 import org.netbeans.modules.cnd.api.toolchain.PlatformTypes;
31.9 import org.netbeans.modules.cnd.api.xml.VersionException;
31.10 import org.netbeans.modules.cnd.api.xml.XMLDecoder;
31.11 import org.netbeans.modules.cnd.api.xml.XMLEncoderStream;
31.12 +import org.netbeans.modules.cnd.makeproject.api.configurations.CompileConfiguration;
31.13 import org.netbeans.modules.cnd.makeproject.api.configurations.Configuration;
31.14 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationAuxObject;
31.15 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptor;
31.16 import org.netbeans.modules.cnd.makeproject.api.configurations.Configurations;
31.17 import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
31.18 +import static org.netbeans.modules.cnd.makeproject.configurations.CommonConfigurationXMLCodec.DEVELOPMENT_SERVER_ELEMENT;
31.19 import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment;
31.20 import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
31.21 import org.xml.sax.Attributes;
31.22 @@ -143,7 +146,25 @@
31.23 }
31.24 ((MakeConfiguration) currentConf).getDevelopmentHost().setBuildPlatform(set);
31.25 }
31.26 - }
31.27 + } else if (element.equals(COMPILE_DIR_ELEMENT)) {
31.28 + if (currentConf instanceof MakeConfiguration) {
31.29 + ((MakeConfiguration) currentConf).getCompileConfiguration().getCompileCommandWorkingDir().setValue(currentText);
31.30 + ((MakeConfiguration) currentConf).getCompileConfiguration().getCompileCommandWorkingDir().getPicklist().addElement(currentText);
31.31 + }
31.32 + } else if (element.equals(COMPILE_DIR_PICKLIST_ITEM_ELEMENT)) {
31.33 + if (currentConf instanceof MakeConfiguration) {
31.34 + ((MakeConfiguration) currentConf).getCompileConfiguration().getCompileCommandWorkingDir().getPicklist().addElement(currentText);
31.35 + }
31.36 + } else if (element.equals(COMPILE_COMMAND_ELEMENT)) {
31.37 + if (currentConf instanceof MakeConfiguration) {
31.38 + ((MakeConfiguration) currentConf).getCompileConfiguration().getCompileCommand().setValue(currentText);
31.39 + ((MakeConfiguration) currentConf).getCompileConfiguration().getCompileCommand().getPicklist().addElement(currentText);
31.40 + }
31.41 + } else if (element.equals(COMPILE_COMMAND_PICKLIST_ITEM_ELEMENT)) {
31.42 + if (currentConf instanceof MakeConfiguration) {
31.43 + ((MakeConfiguration) currentConf).getCompileConfiguration().getCompileCommand().getPicklist().addElement(currentText);
31.44 + }
31.45 + }
31.46 }
31.47
31.48 @Override
31.49 @@ -157,4 +178,31 @@
31.50 xes.element(PLATFORM_ELEMENT, "" + makeConfiguration.getDevelopmentHost().getBuildPlatform()); // NOI18N
31.51 xes.elementClose(TOOLS_SET_ELEMENT);
31.52 }
31.53 +
31.54 + @Override
31.55 + protected void writeCompileConfBlock(XMLEncoderStream xes, MakeConfiguration makeConfiguration) {
31.56 + if (makeConfiguration.isMakefileConfiguration()) {
31.57 + CompileConfiguration compileConfiguration = makeConfiguration.getCompileConfiguration();
31.58 + xes.elementOpen(COMPILE_ID);
31.59 +
31.60 + xes.elementOpen(COMPILE_DIR_PICKLIST_ELEMENT);
31.61 + PicklistElement[] elements = compileConfiguration.getCompileCommandWorkingDir().getPicklist().getElements();
31.62 + for (int i = (elements.length-1); i >= 0; i--) {
31.63 + xes.element(COMPILE_DIR_PICKLIST_ITEM_ELEMENT, elements[i].displayName());
31.64 + }
31.65 + xes.elementClose(COMPILE_DIR_PICKLIST_ELEMENT);
31.66 + xes.element(COMPILE_DIR_ELEMENT, compileConfiguration.getCompileCommandWorkingDir().getValue());
31.67 +
31.68 + xes.elementOpen(COMPILE_COMMAND_PICKLIST_ELEMENT);
31.69 + elements = compileConfiguration.getCompileCommand().getPicklist().getElements();
31.70 + for (int i = (elements.length-1); i >= 0; i--) {
31.71 + xes.element(COMPILE_COMMAND_PICKLIST_ITEM_ELEMENT, elements[i].displayName());
31.72 + }
31.73 + xes.elementClose(COMPILE_COMMAND_PICKLIST_ELEMENT);
31.74 + xes.element(COMPILE_COMMAND_ELEMENT, compileConfiguration.getCompileCommand().getValue());
31.75 +
31.76 + xes.elementClose(COMPILE_ID);
31.77 + }
31.78 + }
31.79 +
31.80 }
32.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/CommonConfigurationXMLCodec.java Tue Feb 19 16:39:13 2013 +0100
32.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/CommonConfigurationXMLCodec.java Wed Feb 20 15:23:50 2013 +0100
32.3 @@ -49,6 +49,7 @@
32.4 import java.util.HashMap;
32.5 import java.util.List;
32.6 import java.util.Map;
32.7 +import org.netbeans.modules.cnd.api.picklist.PicklistElement;
32.8 import org.netbeans.modules.cnd.api.xml.AttrValuePair;
32.9 import org.netbeans.modules.cnd.api.xml.XMLDecoder;
32.10 import org.netbeans.modules.cnd.api.xml.XMLEncoder;
32.11 @@ -64,6 +65,7 @@
32.12 import org.netbeans.modules.cnd.makeproject.api.configurations.CCCompilerConfiguration;
32.13 import org.netbeans.modules.cnd.makeproject.api.configurations.CCompilerConfiguration;
32.14 import org.netbeans.modules.cnd.makeproject.api.configurations.CodeAssistanceConfiguration;
32.15 +import org.netbeans.modules.cnd.makeproject.api.configurations.CompileConfiguration;
32.16 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationAuxObject;
32.17 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptor;
32.18 import org.netbeans.modules.cnd.makeproject.api.configurations.Configurations;
32.19 @@ -90,6 +92,8 @@
32.20 * Common subclass to ConfigurationXMLCodec and AuxConfigurationXMLCodec.
32.21 *
32.22 * Change History:
32.23 + * V89 - NB 8.0
32.24 + * support compile command
32.25 * V88 - NB 7.3 (!!!!!!!!!!INVERTED SERIALIZATION!!!!!!!!!!!!)
32.26 * 1) This is the version where serialization of unmanaged projects were inverted
32.27 * instead of excluded items and personally attributed items we store all
32.28 @@ -265,7 +269,7 @@
32.29 implements XMLEncoder {
32.30
32.31 public final static int VERSION_WITH_INVERTED_SERIALIZATION = 88;
32.32 - public final static int CURRENT_VERSION = 88;
32.33 + public final static int CURRENT_VERSION = 89;
32.34 // Generic
32.35 protected final static String PROJECT_DESCRIPTOR_ELEMENT = "projectDescriptor"; // NOI18N
32.36 protected final static String DEBUGGING_ELEMENT = "justfordebugging"; // NOI18N
32.37 @@ -312,6 +316,14 @@
32.38 protected final static String BUILD_COMMAND_WORKING_DIR_ELEMENT = "buildCommandWorkingDir"; // NOI18N
32.39 protected final static String CLEAN_COMMAND_ELEMENT = "cleanCommand"; // NOI18N
32.40 protected final static String EXECUTABLE_PATH_ELEMENT = "executablePath"; // NOI18N
32.41 + // Compile
32.42 + protected static final String COMPILE_ID = "compile"; // NOI18N
32.43 + protected final static String COMPILE_DIR_ELEMENT = "compiledir"; // NOI18N
32.44 + protected final static String COMPILE_DIR_PICKLIST_ELEMENT = "compiledirpicklist"; // NOI18N
32.45 + protected final static String COMPILE_DIR_PICKLIST_ITEM_ELEMENT = "compiledirpicklistitem"; // NOI18N
32.46 + protected final static String COMPILE_COMMAND_ELEMENT = "compilecommand"; // NOI18N
32.47 + protected final static String COMPILE_COMMAND_PICKLIST_ELEMENT = "compilecommandpicklist"; // NOI18N
32.48 + protected final static String COMPILE_COMMAND_PICKLIST_ITEM_ELEMENT = "compilecommandpicklistitem"; // NOI18N
32.49 // Common
32.50 protected final static String COMMANDLINE_TOOL_ELEMENT = "commandlineTool"; // NOI18N
32.51 protected final static String ADDITIONAL_DEP_ELEMENT = "additionalDep"; // NOI18N
32.52 @@ -497,6 +509,7 @@
32.53 }
32.54
32.55 writeToolsSetBlock(xes, makeConfiguration);
32.56 + writeCompileConfBlock(xes, makeConfiguration);
32.57 if (publicLocation) {
32.58 if (makeConfiguration.isQmakeConfiguration()) {
32.59 writeQmakeConfiguration(xes, makeConfiguration.getQmakeConfiguration());
32.60 @@ -534,6 +547,8 @@
32.61
32.62 protected abstract void writeToolsSetBlock(XMLEncoderStream xes, MakeConfiguration makeConfiguration);
32.63
32.64 + protected abstract void writeCompileConfBlock(XMLEncoderStream xes, MakeConfiguration makeConfiguration);
32.65 +
32.66 private void writeCompiledProjectConfBlock(XMLEncoderStream xes, MakeConfiguration makeConfiguration) {
32.67 xes.elementOpen(COMPILE_TYPE_ELEMENT);
32.68 writeCCompilerConfiguration(xes, makeConfiguration.getCCompilerConfiguration(), PROJECT_LEVEL);
33.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ConfigurationXMLCodec.java Tue Feb 19 16:39:13 2013 +0100
33.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ConfigurationXMLCodec.java Wed Feb 20 15:23:50 2013 +0100
33.3 @@ -1021,7 +1021,7 @@
33.4 } catch (FileStateInvalidException ex) {
33.5 throw new IllegalStateException(ex);
33.6 }
33.7 - MakeConfiguration makeConfiguration = new MakeConfiguration(fsPath, getString(value), confType, customizerId, host);
33.8 + MakeConfiguration makeConfiguration = MakeConfiguration.createConfiguration(fsPath, getString(value), confType, customizerId, host);
33.9 return makeConfiguration;
33.10 }
33.11
33.12 @@ -1063,4 +1063,8 @@
33.13 }
33.14 xes.elementClose(TOOLS_SET_ELEMENT);
33.15 }
33.16 +
33.17 + @Override
33.18 + protected void writeCompileConfBlock(XMLEncoderStream xes, MakeConfiguration makeConfiguration) {
33.19 + }
33.20 }
34.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/MakeLogicalViewRootNode.java Tue Feb 19 16:39:13 2013 +0100
34.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/MakeLogicalViewRootNode.java Wed Feb 20 15:23:50 2013 +0100
34.3 @@ -56,7 +56,6 @@
34.4 import java.util.Iterator;
34.5 import java.util.LinkedHashSet;
34.6 import java.util.List;
34.7 -import java.util.ResourceBundle;
34.8 import java.util.Set;
34.9 import java.util.logging.Level;
34.10 import java.util.logging.Logger;
34.11 @@ -72,13 +71,9 @@
34.12 import org.netbeans.modules.cnd.api.project.NativeProject;
34.13 import org.netbeans.modules.cnd.api.toolchain.CompilerSetManager;
34.14 import org.netbeans.modules.cnd.api.toolchain.ui.ToolsCacheManager;
34.15 -import org.netbeans.modules.cnd.makeproject.MakeActionProvider;
34.16 import org.netbeans.modules.cnd.makeproject.MakeProject;
34.17 import org.netbeans.modules.cnd.makeproject.MakeProjectConfigurationProvider;
34.18 import org.netbeans.modules.cnd.makeproject.MakeProjectTypeImpl;
34.19 -import org.netbeans.modules.cnd.makeproject.actions.AddExistingFolderItemsAction;
34.20 -import org.netbeans.modules.cnd.makeproject.api.actions.AddExistingItemAction;
34.21 -import org.netbeans.modules.cnd.makeproject.api.actions.NewFolderAction;
34.22 import org.netbeans.modules.cnd.makeproject.api.configurations.Configuration;
34.23 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptor.State;
34.24 import org.netbeans.modules.cnd.makeproject.api.configurations.Configurations;
34.25 @@ -89,10 +84,8 @@
34.26 import org.netbeans.modules.cnd.makeproject.configurations.CommonConfigurationXMLCodec;
34.27 import org.netbeans.modules.cnd.utils.cache.CndFileUtils;
34.28 import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment;
34.29 -import org.netbeans.spi.project.ActionProvider;
34.30 import org.netbeans.spi.project.ProjectConfigurationProvider;
34.31 import org.netbeans.spi.project.ui.support.CommonProjectActions;
34.32 -import org.netbeans.spi.project.ui.support.ProjectSensitiveActions;
34.33 import org.openide.filesystems.FileObject;
34.34 import org.openide.nodes.Children;
34.35 import org.openide.nodes.Node;
34.36 @@ -101,11 +94,9 @@
34.37 import org.openide.util.Lookup;
34.38 import org.openide.util.LookupEvent;
34.39 import org.openide.util.LookupListener;
34.40 -import org.openide.util.NbBundle;
34.41 import org.openide.util.RequestProcessor;
34.42 import org.openide.util.Utilities;
34.43 import org.openide.util.WeakListeners;
34.44 -import org.openide.util.actions.SystemAction;
34.45 import org.openide.util.datatransfer.PasteType;
34.46 import org.openide.util.lookup.AbstractLookup;
34.47 import org.openide.util.lookup.InstanceContent;
34.48 @@ -118,7 +109,6 @@
34.49 */
34.50 final class MakeLogicalViewRootNode extends AnnotatedNode implements ChangeListener, LookupListener, PropertyChangeListener {
34.51
34.52 - private static final boolean SYNC_PROJECT_ACTION = Boolean.getBoolean("cnd.remote.sync.project.action"); // NOI18N
34.53
34.54 private boolean brokenLinks;
34.55 private boolean brokenIncludes;
34.56 @@ -488,30 +478,17 @@
34.57 descriptor.getLogicalFolders();
34.58 }
34.59
34.60 - // Add standard actions
34.61 - Action[] standardActions;
34.62 MakeConfiguration active = (descriptor == null) ? null : descriptor.getActiveConfiguration();
34.63 - if (descriptor == null || active == null || active.isMakefileConfiguration()) { // FIXUP: need better check
34.64 - standardActions = getAdditionalDiskFolderActions();
34.65 - } else {
34.66 - standardActions = getAdditionalLogicalFolderActions();
34.67 - }
34.68 - actions.addAll(Arrays.asList(standardActions));
34.69 + String projectType = MakeProjectTypeImpl.PROJECT_TYPE;
34.70 + Action[] projectActions = null;
34.71 + if (active != null && active.isCustomConfiguration()) {
34.72 + //TODO: fix it as all actions can use HIDE_WHEN_DISABLE and be enabled in own context only
34.73 + projectActions = active.getProjectCustomizer().getActions(getProject(), Arrays.asList(CommonProjectActions.forType(projectType)));
34.74 + projectType = active.getProjectCustomizer().getCustomizerId();
34.75 + }
34.76 + projectActions = projectActions == null ? CommonProjectActions.forType(projectType) : projectActions;
34.77 + actions.addAll(Arrays.asList(projectActions));
34.78 actions.add(null);
34.79 - //actions.add(new CodeAssistanceAction());
34.80 - // makeproject sensitive actions
34.81 - final MakeProjectTypeImpl projectKind = provider.getProject().getLookup().lookup(MakeProjectTypeImpl.class);
34.82 - final List<? extends Action> actionsForMakeProject = Utilities.actionsForPath(projectKind.projectActionsPath());
34.83 - if (!actionsForMakeProject.isEmpty()) {
34.84 - actions.addAll(actionsForMakeProject);
34.85 - actions.add(null);
34.86 - }
34.87 - actions.add(SystemAction.get(org.openide.actions.FindAction.class));
34.88 - // all project sensitive actions
34.89 - actions.addAll(Utilities.actionsForPath("Projects/Actions")); // NOI18N
34.90 - // Add remaining actions
34.91 - actions.add(null);
34.92 - //actions.add(SystemAction.get(ToolsAction.class));
34.93 if (brokenLinks) {
34.94 actions.add(new ResolveReferenceAction(provider.getProject()));
34.95 }
34.96 @@ -520,14 +497,8 @@
34.97 }
34.98 if (incorrectPlatform) {
34.99 actions.add(new ResolveIncorrectPlatformAction(this));
34.100 - }
34.101 - //actions.add(null);
34.102 - actions.add(CommonProjectActions.customizeProjectAction());
34.103 - if (active != null && active.isCustomConfiguration() && active.getProjectCustomizer().getActions(provider.getProject(), actions) != null) {
34.104 - return active.getProjectCustomizer().getActions(provider.getProject(), actions);
34.105 - } else {
34.106 - return actions.toArray(new Action[actions.size()]);
34.107 - }
34.108 + }
34.109 + return actions.toArray(new Action[actions.size()]);
34.110 }
34.111
34.112 @Override
34.113 @@ -561,120 +532,7 @@
34.114 }
34.115 super.createPasteTypes(transferable, list);
34.116 }
34.117 -
34.118 - // Private methods -------------------------------------------------
34.119 - private Action[] getAdditionalLogicalFolderActions() {
34.120 -
34.121 - ResourceBundle bundle = NbBundle.getBundle(MakeLogicalViewProvider.class);
34.122 -
34.123 - MoreBuildActionsAction mba = null;
34.124 - ArrayList<Action> actions = new ArrayList<Action>();
34.125 - if (gotMakeConfigurationDescriptor() && getMakeConfigurationDescriptor().getActiveConfiguration() != null && getMakeConfigurationDescriptor().getActiveConfiguration().getConfigurationType().getValue() == MakeConfiguration.TYPE_MAKEFILE) {
34.126 - actions.addAll(Arrays.asList(new Action[]{
34.127 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, bundle.getString("LBL_CleanAction_Name"), null), // NOI18N
34.128 - ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BATCH_BUILD, bundle.getString("LBL_BatchBuildAction_Name"), null), // NOI18N
34.129 - }));
34.130 - actions.addAll(Utilities.actionsForPath("CND/Actions/MoreBuildCommands/LogicalFolder")); //NOI18N
34.131 - mba = new MoreBuildActionsAction(actions.toArray(new Action[0]));
34.132 - } else {
34.133 - actions.addAll(Arrays.asList(new Action[]{
34.134 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, bundle.getString("LBL_CleanAction_Name"), null), // NOI18N
34.135 - ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BATCH_BUILD, bundle.getString("LBL_BatchBuildAction_Name"), null), // NOI18N
34.136 - ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BUILD_PACKAGE, bundle.getString("LBL_BuildPackagesAction_Name"), null), // NOI18N
34.137 - }));
34.138 - actions.addAll(Utilities.actionsForPath("CND/Actions/MoreBuildCommands/LogicalFolder")); //NOI18N
34.139 - mba = new MoreBuildActionsAction(actions.toArray(new Action[0]));
34.140 - }
34.141 -
34.142 - Action[] result = new Action[]{
34.143 - CommonProjectActions.newFileAction(),
34.144 - null,
34.145 - SystemAction.get(AddExistingItemAction.class),
34.146 - SystemAction.get(AddExistingFolderItemsAction.class),
34.147 - SystemAction.get(NewFolderAction.class),
34.148 - //new AddExternalItemAction(project),
34.149 - null,
34.150 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, bundle.getString("LBL_BuildAction_Name"), null), // NOI18N
34.151 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, bundle.getString("LBL_RebuildAction_Name"), null), // NOI18N
34.152 - mba,
34.153 - new SetConfigurationAction(getProject()),
34.154 - new RemoteDevelopmentAction(getProject()),
34.155 - null,
34.156 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_RUN, bundle.getString("LBL_RunAction_Name"), null), // NOI18N
34.157 - //new DebugMenuAction(project, helper),
34.158 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, bundle.getString("LBL_DebugAction_Name"), null),
34.159 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG_STEP_INTO, bundle.getString("LBL_DebugAction_Step_Name"), null),
34.160 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST, bundle.getString("LBL_TestAction_Name"), null),
34.161 - //SystemAction.get(RunTestAction.class),
34.162 - null,
34.163 - CommonProjectActions.setAsMainProjectAction(),
34.164 - CommonProjectActions.openSubprojectsAction(),
34.165 - CommonProjectActions.closeProjectAction(),
34.166 - null,
34.167 - CommonProjectActions.renameProjectAction(),
34.168 - CommonProjectActions.moveProjectAction(),
34.169 - CommonProjectActions.copyProjectAction(),
34.170 - CommonProjectActions.deleteProjectAction(),
34.171 - null,};
34.172 - if (SYNC_PROJECT_ACTION) {
34.173 - result = NodeActionFactory.insertSyncActions(result, RemoteDevelopmentAction.class);
34.174 - }
34.175 - return result;
34.176 - }
34.177 -
34.178 - private Action[] getAdditionalDiskFolderActions() {
34.179 -
34.180 - ResourceBundle bundle = NbBundle.getBundle(MakeLogicalViewProvider.class);
34.181 -
34.182 - MoreBuildActionsAction mba = null;
34.183 - ArrayList<Action> actions = new ArrayList<Action>();
34.184 - if (gotMakeConfigurationDescriptor() && getMakeConfigurationDescriptor().getActiveConfiguration() != null && getMakeConfigurationDescriptor().getActiveConfiguration().getConfigurationType().getValue() == MakeConfiguration.TYPE_MAKEFILE) {
34.185 - actions.addAll(Arrays.asList(new Action[]{
34.186 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, bundle.getString("LBL_CleanAction_Name"), null), // NOI18N
34.187 - ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BATCH_BUILD, bundle.getString("LBL_BatchBuildAction_Name"), null), // NOI18N
34.188 - }));
34.189 - actions.addAll(Utilities.actionsForPath("CND/Actions/MoreBuildCommands/DiskFolder")); //NOI18N
34.190 - mba = new MoreBuildActionsAction(actions.toArray(new Action[0]));
34.191 - } else {
34.192 - actions.addAll(Arrays.asList(new Action[]{
34.193 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, bundle.getString("LBL_CleanAction_Name"), null), // NOI18N
34.194 - ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BATCH_BUILD, bundle.getString("LBL_BatchBuildAction_Name"), null), // NOI18N
34.195 - ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BUILD_PACKAGE, bundle.getString("LBL_BuildPackagesAction_Name"), null), // NOI18N
34.196 - }));
34.197 - actions.addAll(Utilities.actionsForPath("CND/Actions/MoreBuildCommands/DiskFolder")); //NOI18N
34.198 - mba = new MoreBuildActionsAction(actions.toArray(new Action[0]));
34.199 - }
34.200 -
34.201 - Action[] result = new Action[]{
34.202 - CommonProjectActions.newFileAction(),
34.203 - //null,
34.204 - //new AddExternalItemAction(project),
34.205 - null,
34.206 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, bundle.getString("LBL_BuildAction_Name"), null), // NOI18N
34.207 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, bundle.getString("LBL_RebuildAction_Name"), null), // NOI18N
34.208 - mba,
34.209 - new SetConfigurationAction(getProject()),
34.210 - new RemoteDevelopmentAction(getProject()),
34.211 - null,
34.212 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_RUN, bundle.getString("LBL_RunAction_Name"), null), // NOI18N
34.213 - //new DebugMenuAction(project, helper),
34.214 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, bundle.getString("LBL_DebugAction_Name"), null),
34.215 - ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG_STEP_INTO, bundle.getString("LBL_DebugAction_Step_Name"), null),
34.216 - null,
34.217 - CommonProjectActions.setAsMainProjectAction(),
34.218 - CommonProjectActions.openSubprojectsAction(),
34.219 - CommonProjectActions.closeProjectAction(),
34.220 - null,
34.221 - CommonProjectActions.renameProjectAction(),
34.222 - CommonProjectActions.moveProjectAction(),
34.223 - CommonProjectActions.copyProjectAction(),
34.224 - CommonProjectActions.deleteProjectAction(),
34.225 - null,};
34.226 - if (SYNC_PROJECT_ACTION) {
34.227 - result = NodeActionFactory.insertSyncActions(result, RemoteDevelopmentAction.class);
34.228 - }
34.229 - return result;
34.230 - }
34.231 +
34.232
34.233 @Override
34.234 public void resultChanged(LookupEvent ev) {
35.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/RemoteDevelopmentAction.java Tue Feb 19 16:39:13 2013 +0100
35.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/RemoteDevelopmentAction.java Wed Feb 20 15:23:50 2013 +0100
35.3 @@ -83,9 +83,9 @@
35.4 private static final String PROJECT = "org.netbeans.modules.cnd.makeproject.api.configurations.MakeProject"; // NOI18N
35.5 private static final RequestProcessor RP = new RequestProcessor("RemoteDevelopmentAction", 1); // NOI18N
35.6 private JMenu subMenu;
35.7 - private MakeProject project;
35.8 + private Project project;
35.9
35.10 - public RemoteDevelopmentAction(MakeProject project) {
35.11 + public RemoteDevelopmentAction(Project project) {
35.12 super(NbBundle.getMessage(RemoteDevelopmentAction.class, "LBL_RemoteDevelopmentAction_Name"), // NOI18N
35.13 null);
35.14 this.project = project;
35.15 @@ -104,7 +104,7 @@
35.16 createSubMenu();
35.17 return subMenu;
35.18 }
35.19 -
35.20 +
35.21 private void createSubMenu() {
35.22 if (subMenu == null) {
35.23 String label = NbBundle.getMessage(RemoteDevelopmentAction.class, "LBL_RemoteDevelopmentAction_Name"); // NOI18N
35.24 @@ -112,9 +112,12 @@
35.25 }
35.26
35.27 subMenu.removeAll();
35.28 -
35.29 - final MakeConfiguration mconf = project.getActiveConfiguration();
35.30 - ExecutionEnvironment currExecEnv = project.getDevelopmentHostExecutionEnvironment();
35.31 + ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
35.32 + if (pdp == null || pdp.getConfigurationDescriptor() == null || pdp.getConfigurationDescriptor().getActiveConfiguration() == null) {
35.33 + return;
35.34 + }
35.35 + final MakeConfiguration mconf = pdp.getConfigurationDescriptor().getActiveConfiguration();
35.36 + ExecutionEnvironment currExecEnv = mconf.getDevelopmentHost().getExecutionEnvironment();
35.37 if (mconf == null || currExecEnv == null) {
35.38 return;
35.39 }
35.40 @@ -140,32 +143,32 @@
35.41 final JMenuItem managePlatformsItem = new JMenuItem(NbBundle.getMessage(RemoteDevelopmentAction.class, "LBL_ManagePlatforms_Name")); // NOI18N
35.42 subMenu.add(managePlatformsItem);
35.43 managePlatformsItem.addActionListener(new ActionListener() {
35.44 - private MakeProject currProject = project;
35.45 + private Project currProject = project;
35.46 public void actionPerformed(ActionEvent event) {
35.47 AtomicReference<ExecutionEnvironment> selectedEnv = new AtomicReference<ExecutionEnvironment>();
35.48 if (ServerListUI.showServerListDialog(selectedEnv)) {
35.49 ExecutionEnvironment env = selectedEnv.get();
35.50 if (env != null) {
35.51 - setRemodeDevelopmentHost(managePlatformsItem, mconf, env, project);
35.52 + setRemoteDevelopmentHost(managePlatformsItem, mconf, env, project);
35.53 }
35.54 }
35.55 }
35.56 });
35.57 }
35.58
35.59 - private static void setRemodeDevelopmentHost(final Object source, final MakeConfiguration mconf, final ExecutionEnvironment execEnv, final Project project) {
35.60 + private static void setRemoteDevelopmentHost(final Object source, final MakeConfiguration mconf, final ExecutionEnvironment execEnv, final Project project) {
35.61 if (SwingUtilities.isEventDispatchThread()) {
35.62 RP.post(new Runnable(){
35.63 public void run() {
35.64 - _setRemodeDevelopmentHost(source, mconf, execEnv, project);
35.65 + _setRemoteDevelopmentHost(source, mconf, execEnv, project);
35.66 }
35.67 });
35.68 } else {
35.69 - _setRemodeDevelopmentHost(source, mconf, execEnv, project);
35.70 + _setRemoteDevelopmentHost(source, mconf, execEnv, project);
35.71 }
35.72 }
35.73
35.74 - private static void _setRemodeDevelopmentHost(Object source, MakeConfiguration mconf, ExecutionEnvironment execEnv, Project project) {
35.75 + private static void _setRemoteDevelopmentHost(Object source, MakeConfiguration mconf, ExecutionEnvironment execEnv, Project project) {
35.76 if (mconf != null && execEnv != null) {
35.77 ServerRecord record = ServerList.get(execEnv);
35.78 if (!record.isSetUp()) {
35.79 @@ -216,7 +219,7 @@
35.80 ExecutionEnvironment execEnv = (ExecutionEnvironment) jmi.getClientProperty(HOST_ENV);
35.81 MakeConfiguration mconf = (MakeConfiguration) jmi.getClientProperty(CONF);
35.82 Project project = (Project) jmi.getClientProperty(PROJECT);
35.83 - setRemodeDevelopmentHost(jmi, mconf, execEnv, project);
35.84 + setRemoteDevelopmentHost(jmi, mconf, execEnv, project);
35.85 }
35.86 }
35.87 }
36.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/RemoteSyncActions.java Tue Feb 19 16:39:13 2013 +0100
36.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/RemoteSyncActions.java Wed Feb 20 15:23:50 2013 +0100
36.3 @@ -71,6 +71,7 @@
36.4 import org.netbeans.modules.nativeexecution.api.util.CommonTasksSupport;
36.5 import org.netbeans.modules.nativeexecution.api.util.ConnectionManager;
36.6 import org.netbeans.modules.nativeexecution.api.util.ConnectionManager.CancellationException;
36.7 +import org.openide.awt.DynamicMenuContent;
36.8 import org.openide.filesystems.FileObject;
36.9 import org.openide.filesystems.FileUtil;
36.10 import org.openide.loaders.DataObject;
36.11 @@ -290,9 +291,17 @@
36.12 protected abstract void performAction(ExecutionEnvironment execEnv, Node[] activatedNodes);
36.13 protected abstract String getDummyItemText();
36.14 protected abstract String getItemText(String hostName);
36.15 +
36.16 + public BaseAction() {
36.17 + putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, Boolean.TRUE);
36.18 + }
36.19
36.20 @Override
36.21 protected boolean enable(Node[] activatedNodes) {
36.22 + boolean isSyncActionsEnabled = Boolean.getBoolean("cnd.remote.sync.project.action");
36.23 + if (!isSyncActionsEnabled) {
36.24 + return false;
36.25 + }
36.26 cacheActiveNodes(activatedNodes);
36.27 ExecutionEnvironment execEnv = getEnv(activatedNodes);
36.28 enabled = execEnv != null && execEnv.isRemote();
36.29 @@ -381,6 +390,17 @@
36.30 }
36.31 });
36.32 }
36.33 +
36.34 + @Override
36.35 + protected boolean enable(Node[] activatedNodes) {
36.36 + boolean isEnabled = super.enable(activatedNodes); //To change body of generated methods, choose Tools | Templates.
36.37 + if (isEnabled) {
36.38 + return Boolean.getBoolean("cnd.remote.download.project.action");
36.39 + }
36.40 + return isEnabled;
36.41 + }
36.42 +
36.43 +
36.44 }
36.45
36.46 private static ExecutionEnvironment getEnv(Node[] activatedNodes) {
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/BuildPackageAction.java Wed Feb 20 15:23:50 2013 +0100
37.3 @@ -0,0 +1,94 @@
37.4 +/*
37.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
37.6 + *
37.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
37.8 + *
37.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
37.10 + * Other names may be trademarks of their respective owners.
37.11 + *
37.12 + * The contents of this file are subject to the terms of either the GNU
37.13 + * General Public License Version 2 only ("GPL") or the Common
37.14 + * Development and Distribution License("CDDL") (collectively, the
37.15 + * "License"). You may not use this file except in compliance with the
37.16 + * License. You can obtain a copy of the License at
37.17 + * http://www.netbeans.org/cddl-gplv2.html
37.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
37.19 + * specific language governing permissions and limitations under the
37.20 + * License. When distributing the software, include this License Header
37.21 + * Notice in each file and include the License file at
37.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
37.23 + * particular file as subject to the "Classpath" exception as provided
37.24 + * by Oracle in the GPL Version 2 section of the License file that
37.25 + * accompanied this code. If applicable, add the following below the
37.26 + * License Header, with the fields enclosed by brackets [] replaced by
37.27 + * your own identifying information:
37.28 + * "Portions Copyrighted [year] [name of copyright owner]"
37.29 + *
37.30 + * If you wish your version of this file to be governed by only the CDDL
37.31 + * or only the GPL Version 2, indicate your decision by adding
37.32 + * "[Contributor] elects to include this software in this distribution
37.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
37.34 + * single choice of license, a recipient has the option to distribute
37.35 + * your version of this file under either the CDDL, the GPL Version 2 or
37.36 + * to extend the choice of license to its licensees as provided above.
37.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
37.38 + * Version 2 license, then the option applies only if the new code is
37.39 + * made subject to such option by the copyright holder.
37.40 + *
37.41 + * Contributor(s):
37.42 + *
37.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
37.44 + */
37.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
37.46 +
37.47 +import javax.swing.Action;
37.48 +import org.netbeans.api.project.Project;
37.49 +import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
37.50 +import org.openide.nodes.Node;
37.51 +import org.openide.util.HelpCtx;
37.52 +
37.53 +/**
37.54 + *
37.55 + * @author mtishkov
37.56 + */
37.57 +public class BuildPackageAction extends MakeProjectContextAwareAction {
37.58 +
37.59 + private final Action deligate;
37.60 +
37.61 + BuildPackageAction() {
37.62 + super();
37.63 + deligate = MakeProjectActionsSupport.buildPackageAction();
37.64 + }
37.65 +
37.66 +
37.67 +
37.68 +
37.69 + @Override
37.70 + protected void performAction(Node[] activatedNodes) {
37.71 + deligate.actionPerformed(null);
37.72 + }
37.73 +
37.74 + @Override
37.75 + protected boolean enable(Node[] activatedNodes) {
37.76 + Project p = getProject(activatedNodes);
37.77 + if (p == null) {
37.78 + return false;
37.79 + }
37.80 + ConfigurationDescriptorProvider pdp = p.getLookup().lookup(ConfigurationDescriptorProvider.class);
37.81 + if (pdp.gotDescriptor() && pdp.getConfigurationDescriptor().getActiveConfiguration() != null
37.82 + && pdp.getConfigurationDescriptor().getActiveConfiguration().isMakefileConfiguration()) {
37.83 + return false;
37.84 + }
37.85 + return true;
37.86 + }
37.87 +
37.88 + @Override
37.89 + public String getName() {
37.90 + return deligate.getValue(Action.SHORT_DESCRIPTION) + "";//NOI18N
37.91 + }
37.92 +
37.93 + @Override
37.94 + public HelpCtx getHelpCtx() {
37.95 + return null;
37.96 + }
37.97 +}
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
38.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/Bundle.properties Wed Feb 20 15:23:50 2013 +0100
38.3 @@ -0,0 +1,40 @@
38.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
38.5 +#
38.6 +# Copyright 2013 Oracle and/or its affiliates. All rights reserved.
38.7 +#
38.8 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
38.9 +# Other names may be trademarks of their respective owners.
38.10 +#
38.11 +# The contents of this file are subject to the terms of either the GNU
38.12 +# General Public License Version 2 only ("GPL") or the Common
38.13 +# Development and Distribution License("CDDL") (collectively, the
38.14 +# "License"). You may not use this file except in compliance with the
38.15 +# License. You can obtain a copy of the License at
38.16 +# http://www.netbeans.org/cddl-gplv2.html
38.17 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
38.18 +# specific language governing permissions and limitations under the
38.19 +# License. When distributing the software, include this License Header
38.20 +# Notice in each file and include the License file at
38.21 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
38.22 +# particular file as subject to the "Classpath" exception as provided
38.23 +# by Oracle in the GPL Version 2 section of the License file that
38.24 +# accompanied this code. If applicable, add the following below the
38.25 +# License Header, with the fields enclosed by brackets [] replaced by
38.26 +# your own identifying information:
38.27 +# "Portions Copyrighted [year] [name of copyright owner]"
38.28 +#
38.29 +# If you wish your version of this file to be governed by only the CDDL
38.30 +# or only the GPL Version 2, indicate your decision by adding
38.31 +# "[Contributor] elects to include this software in this distribution
38.32 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
38.33 +# single choice of license, a recipient has the option to distribute
38.34 +# your version of this file under either the CDDL, the GPL Version 2 or
38.35 +# to extend the choice of license to its licensees as provided above.
38.36 +# However, if you add GPL Version 2 code and therefore, elected the GPL
38.37 +# Version 2 license, then the option applies only if the new code is
38.38 +# made subject to such option by the copyright holder.
38.39 +#
38.40 +# Contributor(s):
38.41 +#
38.42 +# Portions Copyrighted 2013 Sun Microsystems, Inc.
38.43 +LBL_MoreBuildActionsAction_Name=More Build Commands
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
39.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/ContextAwareWrapperAction.java Wed Feb 20 15:23:50 2013 +0100
39.3 @@ -0,0 +1,105 @@
39.4 +/*
39.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
39.6 + *
39.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
39.8 + *
39.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
39.10 + * Other names may be trademarks of their respective owners.
39.11 + *
39.12 + * The contents of this file are subject to the terms of either the GNU
39.13 + * General Public License Version 2 only ("GPL") or the Common
39.14 + * Development and Distribution License("CDDL") (collectively, the
39.15 + * "License"). You may not use this file except in compliance with the
39.16 + * License. You can obtain a copy of the License at
39.17 + * http://www.netbeans.org/cddl-gplv2.html
39.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
39.19 + * specific language governing permissions and limitations under the
39.20 + * License. When distributing the software, include this License Header
39.21 + * Notice in each file and include the License file at
39.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
39.23 + * particular file as subject to the "Classpath" exception as provided
39.24 + * by Oracle in the GPL Version 2 section of the License file that
39.25 + * accompanied this code. If applicable, add the following below the
39.26 + * License Header, with the fields enclosed by brackets [] replaced by
39.27 + * your own identifying information:
39.28 + * "Portions Copyrighted [year] [name of copyright owner]"
39.29 + *
39.30 + * If you wish your version of this file to be governed by only the CDDL
39.31 + * or only the GPL Version 2, indicate your decision by adding
39.32 + * "[Contributor] elects to include this software in this distribution
39.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
39.34 + * single choice of license, a recipient has the option to distribute
39.35 + * your version of this file under either the CDDL, the GPL Version 2 or
39.36 + * to extend the choice of license to its licensees as provided above.
39.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
39.38 + * Version 2 license, then the option applies only if the new code is
39.39 + * made subject to such option by the copyright holder.
39.40 + *
39.41 + * Contributor(s):
39.42 + *
39.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
39.44 + */
39.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
39.46 +
39.47 +import javax.swing.Action;
39.48 +import javax.swing.JMenuItem;
39.49 +import org.netbeans.api.project.Project;
39.50 +import org.netbeans.modules.cnd.makeproject.ui.RemoteDevelopmentAction;
39.51 +import org.openide.nodes.Node;
39.52 +import org.openide.util.HelpCtx;
39.53 +import org.openide.util.NbBundle;
39.54 +import org.openide.util.actions.Presenter;
39.55 +
39.56 +/**
39.57 + *
39.58 + * @author mtishkov
39.59 + */
39.60 +abstract public class ContextAwareWrapperAction extends MakeProjectContextAwareAction implements Presenter.Menu, Presenter.Popup{
39.61 +
39.62 + private Action deligateAction;
39.63 +
39.64 + abstract protected Action createDeligateAction(Project p);
39.65 +
39.66 + @Override
39.67 + protected void performAction(Node[] activatedNodes) {
39.68 + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
39.69 + }
39.70 +
39.71 +
39.72 +
39.73 + @Override
39.74 + protected boolean enable(Node[] activatedNodes) {
39.75 + // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
39.76 + //find project
39.77 + Project p = getProject(activatedNodes);
39.78 + if (p == null) {
39.79 + return false;
39.80 + }
39.81 + deligateAction = createDeligateAction(p);
39.82 + return true;
39.83 + }
39.84 +
39.85 +
39.86 + @Override
39.87 + public HelpCtx getHelpCtx() {
39.88 + return null;
39.89 + }
39.90 +
39.91 + @Override
39.92 + public JMenuItem getPopupPresenter() {
39.93 + if (Presenter.Popup.class.isAssignableFrom(deligateAction.getClass())) {
39.94 + return ((Presenter.Popup)deligateAction).getPopupPresenter();
39.95 + }
39.96 + return null;
39.97 + }
39.98 +
39.99 + @Override
39.100 + public JMenuItem getMenuPresenter() {
39.101 + if (Presenter.Menu.class.isAssignableFrom(deligateAction.getClass())) {
39.102 + return ((Presenter.Menu)deligateAction).getMenuPresenter();
39.103 + }
39.104 + return null;
39.105 + }
39.106 +
39.107 +
39.108 +}
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
40.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/MakeProjectActionsSupport.java Wed Feb 20 15:23:50 2013 +0100
40.3 @@ -0,0 +1,79 @@
40.4 +/*
40.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
40.6 + *
40.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
40.8 + *
40.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
40.10 + * Other names may be trademarks of their respective owners.
40.11 + *
40.12 + * The contents of this file are subject to the terms of either the GNU
40.13 + * General Public License Version 2 only ("GPL") or the Common
40.14 + * Development and Distribution License("CDDL") (collectively, the
40.15 + * "License"). You may not use this file except in compliance with the
40.16 + * License. You can obtain a copy of the License at
40.17 + * http://www.netbeans.org/cddl-gplv2.html
40.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
40.19 + * specific language governing permissions and limitations under the
40.20 + * License. When distributing the software, include this License Header
40.21 + * Notice in each file and include the License file at
40.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
40.23 + * particular file as subject to the "Classpath" exception as provided
40.24 + * by Oracle in the GPL Version 2 section of the License file that
40.25 + * accompanied this code. If applicable, add the following below the
40.26 + * License Header, with the fields enclosed by brackets [] replaced by
40.27 + * your own identifying information:
40.28 + * "Portions Copyrighted [year] [name of copyright owner]"
40.29 + *
40.30 + * If you wish your version of this file to be governed by only the CDDL
40.31 + * or only the GPL Version 2, indicate your decision by adding
40.32 + * "[Contributor] elects to include this software in this distribution
40.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
40.34 + * single choice of license, a recipient has the option to distribute
40.35 + * your version of this file under either the CDDL, the GPL Version 2 or
40.36 + * to extend the choice of license to its licensees as provided above.
40.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
40.38 + * Version 2 license, then the option applies only if the new code is
40.39 + * made subject to such option by the copyright holder.
40.40 + *
40.41 + * Contributor(s):
40.42 + *
40.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
40.44 + */
40.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
40.46 +
40.47 +import java.util.ResourceBundle;
40.48 +import javax.swing.Action;
40.49 +import org.netbeans.modules.cnd.makeproject.MakeActionProvider;
40.50 +import org.netbeans.modules.cnd.makeproject.ui.MakeLogicalViewProvider;
40.51 +import org.netbeans.spi.project.ActionProvider;
40.52 +import org.netbeans.spi.project.ui.support.ProjectSensitiveActions;
40.53 +import org.openide.util.NbBundle;
40.54 +
40.55 +/**
40.56 + *
40.57 + * @author mtishkov
40.58 + */
40.59 +public class MakeProjectActionsSupport {
40.60 + private static final ResourceBundle bundle = NbBundle.getBundle(MakeLogicalViewProvider.class);
40.61 +
40.62 + public static Action batchBuildAction() {
40.63 + return ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BATCH_BUILD, bundle.getString("LBL_BatchBuildAction_Name"), null); // NOI18N
40.64 + }
40.65 +
40.66 + public static Action buildPackageAction() {
40.67 + return ProjectSensitiveActions.projectCommandAction(MakeActionProvider.COMMAND_BUILD_PACKAGE, bundle.getString("LBL_BuildPackagesAction_Name"), null); // NOI18N
40.68 + }
40.69 +
40.70 + public static Action debugAction() {
40.71 + return ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, bundle.getString("LBL_DebugAction_Name"), null);//NOI18N
40.72 + }
40.73 +
40.74 + public static Action stepIntoAction() {
40.75 + return ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG_STEP_INTO, bundle.getString("LBL_DebugAction_Step_Name"), null);//NOI18N
40.76 + }
40.77 +
40.78 + public static Action testAction() {
40.79 + return ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST, bundle.getString("LBL_TestAction_Name"), null);//NOI18N
40.80 + }
40.81 +
40.82 +}
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
41.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/MakeProjectBuildHostAction.java Wed Feb 20 15:23:50 2013 +0100
41.3 @@ -0,0 +1,67 @@
41.4 +/*
41.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
41.6 + *
41.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
41.8 + *
41.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
41.10 + * Other names may be trademarks of their respective owners.
41.11 + *
41.12 + * The contents of this file are subject to the terms of either the GNU
41.13 + * General Public License Version 2 only ("GPL") or the Common
41.14 + * Development and Distribution License("CDDL") (collectively, the
41.15 + * "License"). You may not use this file except in compliance with the
41.16 + * License. You can obtain a copy of the License at
41.17 + * http://www.netbeans.org/cddl-gplv2.html
41.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
41.19 + * specific language governing permissions and limitations under the
41.20 + * License. When distributing the software, include this License Header
41.21 + * Notice in each file and include the License file at
41.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
41.23 + * particular file as subject to the "Classpath" exception as provided
41.24 + * by Oracle in the GPL Version 2 section of the License file that
41.25 + * accompanied this code. If applicable, add the following below the
41.26 + * License Header, with the fields enclosed by brackets [] replaced by
41.27 + * your own identifying information:
41.28 + * "Portions Copyrighted [year] [name of copyright owner]"
41.29 + *
41.30 + * If you wish your version of this file to be governed by only the CDDL
41.31 + * or only the GPL Version 2, indicate your decision by adding
41.32 + * "[Contributor] elects to include this software in this distribution
41.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
41.34 + * single choice of license, a recipient has the option to distribute
41.35 + * your version of this file under either the CDDL, the GPL Version 2 or
41.36 + * to extend the choice of license to its licensees as provided above.
41.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
41.38 + * Version 2 license, then the option applies only if the new code is
41.39 + * made subject to such option by the copyright holder.
41.40 + *
41.41 + * Contributor(s):
41.42 + *
41.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
41.44 + */
41.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
41.46 +
41.47 +import javax.swing.Action;
41.48 +import org.netbeans.api.project.Project;
41.49 +import org.netbeans.modules.cnd.makeproject.ui.RemoteDevelopmentAction;
41.50 +import org.openide.util.NbBundle;
41.51 +
41.52 +/**
41.53 + *
41.54 + * @author mtishkov
41.55 + */
41.56 +public class MakeProjectBuildHostAction extends ContextAwareWrapperAction {
41.57 +
41.58 +
41.59 + @Override
41.60 + public String getName() {
41.61 + return NbBundle.getMessage(RemoteDevelopmentAction.class, "LBL_RemoteDevelopmentAction_Name");//NOI18N
41.62 + }
41.63 +
41.64 + @Override
41.65 + protected Action createDeligateAction(Project p) {
41.66 + return new RemoteDevelopmentAction(p);
41.67 + }
41.68 +
41.69 +
41.70 +}
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/MakeProjectConfigurationAction.java Wed Feb 20 15:23:50 2013 +0100
42.3 @@ -0,0 +1,67 @@
42.4 +/*
42.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
42.6 + *
42.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
42.8 + *
42.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
42.10 + * Other names may be trademarks of their respective owners.
42.11 + *
42.12 + * The contents of this file are subject to the terms of either the GNU
42.13 + * General Public License Version 2 only ("GPL") or the Common
42.14 + * Development and Distribution License("CDDL") (collectively, the
42.15 + * "License"). You may not use this file except in compliance with the
42.16 + * License. You can obtain a copy of the License at
42.17 + * http://www.netbeans.org/cddl-gplv2.html
42.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
42.19 + * specific language governing permissions and limitations under the
42.20 + * License. When distributing the software, include this License Header
42.21 + * Notice in each file and include the License file at
42.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
42.23 + * particular file as subject to the "Classpath" exception as provided
42.24 + * by Oracle in the GPL Version 2 section of the License file that
42.25 + * accompanied this code. If applicable, add the following below the
42.26 + * License Header, with the fields enclosed by brackets [] replaced by
42.27 + * your own identifying information:
42.28 + * "Portions Copyrighted [year] [name of copyright owner]"
42.29 + *
42.30 + * If you wish your version of this file to be governed by only the CDDL
42.31 + * or only the GPL Version 2, indicate your decision by adding
42.32 + * "[Contributor] elects to include this software in this distribution
42.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
42.34 + * single choice of license, a recipient has the option to distribute
42.35 + * your version of this file under either the CDDL, the GPL Version 2 or
42.36 + * to extend the choice of license to its licensees as provided above.
42.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
42.38 + * Version 2 license, then the option applies only if the new code is
42.39 + * made subject to such option by the copyright holder.
42.40 + *
42.41 + * Contributor(s):
42.42 + *
42.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
42.44 + */
42.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
42.46 +
42.47 +import javax.swing.Action;
42.48 +import org.netbeans.api.project.Project;
42.49 +import org.netbeans.modules.cnd.makeproject.ui.SetConfigurationAction;
42.50 +import org.openide.util.NbBundle;
42.51 +
42.52 +/**
42.53 + *
42.54 + * @author mtishkov
42.55 + */
42.56 +public class MakeProjectConfigurationAction extends ContextAwareWrapperAction {
42.57 +
42.58 +
42.59 + @Override
42.60 + protected Action createDeligateAction(Project p) {
42.61 + return new SetConfigurationAction(p);
42.62 + }
42.63 +
42.64 +
42.65 + @Override
42.66 + public String getName() {
42.67 + return NbBundle.getMessage( SetConfigurationAction.class, "LBL_SetConfigurationAction_Name");//NOI18N
42.68 + }
42.69 +
42.70 +}
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/MakeProjectContextAwareAction.java Wed Feb 20 15:23:50 2013 +0100
43.3 @@ -0,0 +1,74 @@
43.4 +/*
43.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
43.6 + *
43.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
43.8 + *
43.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
43.10 + * Other names may be trademarks of their respective owners.
43.11 + *
43.12 + * The contents of this file are subject to the terms of either the GNU
43.13 + * General Public License Version 2 only ("GPL") or the Common
43.14 + * Development and Distribution License("CDDL") (collectively, the
43.15 + * "License"). You may not use this file except in compliance with the
43.16 + * License. You can obtain a copy of the License at
43.17 + * http://www.netbeans.org/cddl-gplv2.html
43.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
43.19 + * specific language governing permissions and limitations under the
43.20 + * License. When distributing the software, include this License Header
43.21 + * Notice in each file and include the License file at
43.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
43.23 + * particular file as subject to the "Classpath" exception as provided
43.24 + * by Oracle in the GPL Version 2 section of the License file that
43.25 + * accompanied this code. If applicable, add the following below the
43.26 + * License Header, with the fields enclosed by brackets [] replaced by
43.27 + * your own identifying information:
43.28 + * "Portions Copyrighted [year] [name of copyright owner]"
43.29 + *
43.30 + * If you wish your version of this file to be governed by only the CDDL
43.31 + * or only the GPL Version 2, indicate your decision by adding
43.32 + * "[Contributor] elects to include this software in this distribution
43.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
43.34 + * single choice of license, a recipient has the option to distribute
43.35 + * your version of this file under either the CDDL, the GPL Version 2 or
43.36 + * to extend the choice of license to its licensees as provided above.
43.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
43.38 + * Version 2 license, then the option applies only if the new code is
43.39 + * made subject to such option by the copyright holder.
43.40 + *
43.41 + * Contributor(s):
43.42 + *
43.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
43.44 + */
43.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
43.46 +
43.47 +import org.netbeans.api.project.Project;
43.48 +import org.openide.awt.DynamicMenuContent;
43.49 +import org.openide.nodes.Node;
43.50 +import org.openide.util.actions.NodeAction;
43.51 +
43.52 +/**
43.53 + *
43.54 + * @author mtishkov
43.55 + */
43.56 +public abstract class MakeProjectContextAwareAction extends NodeAction {
43.57 +
43.58 +
43.59 + public MakeProjectContextAwareAction() {
43.60 + putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, Boolean.TRUE);
43.61 + }
43.62 +
43.63 +
43.64 +
43.65 + protected final Project getProject(Node[] activatedNodes) {
43.66 + if (activatedNodes.length != 1) {
43.67 + return null;
43.68 + }
43.69 + Object project = activatedNodes[0].getValue("Project"); // NOI18N
43.70 + if (project == null || (!(project instanceof Project))) {
43.71 + return null;
43.72 + }
43.73 + return (Project)project;
43.74 +
43.75 + }
43.76 +
43.77 +}
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/actions/MoreBuildActionsAction.java Wed Feb 20 15:23:50 2013 +0100
44.3 @@ -0,0 +1,147 @@
44.4 +/*
44.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
44.6 + *
44.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
44.8 + *
44.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
44.10 + * Other names may be trademarks of their respective owners.
44.11 + *
44.12 + * The contents of this file are subject to the terms of either the GNU
44.13 + * General Public License Version 2 only ("GPL") or the Common
44.14 + * Development and Distribution License("CDDL") (collectively, the
44.15 + * "License"). You may not use this file except in compliance with the
44.16 + * License. You can obtain a copy of the License at
44.17 + * http://www.netbeans.org/cddl-gplv2.html
44.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
44.19 + * specific language governing permissions and limitations under the
44.20 + * License. When distributing the software, include this License Header
44.21 + * Notice in each file and include the License file at
44.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
44.23 + * particular file as subject to the "Classpath" exception as provided
44.24 + * by Oracle in the GPL Version 2 section of the License file that
44.25 + * accompanied this code. If applicable, add the following below the
44.26 + * License Header, with the fields enclosed by brackets [] replaced by
44.27 + * your own identifying information:
44.28 + * "Portions Copyrighted [year] [name of copyright owner]"
44.29 + *
44.30 + * If you wish your version of this file to be governed by only the CDDL
44.31 + * or only the GPL Version 2, indicate your decision by adding
44.32 + * "[Contributor] elects to include this software in this distribution
44.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
44.34 + * single choice of license, a recipient has the option to distribute
44.35 + * your version of this file under either the CDDL, the GPL Version 2 or
44.36 + * to extend the choice of license to its licensees as provided above.
44.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
44.38 + * Version 2 license, then the option applies only if the new code is
44.39 + * made subject to such option by the copyright holder.
44.40 + *
44.41 + * Contributor(s):
44.42 + *
44.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
44.44 + */
44.45 +package org.netbeans.modules.cnd.makeproject.ui.actions;
44.46 +
44.47 +import java.util.ArrayList;
44.48 +import javax.swing.Action;
44.49 +import javax.swing.JMenu;
44.50 +import javax.swing.JMenuItem;
44.51 +import org.netbeans.api.project.Project;
44.52 +import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
44.53 +import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
44.54 +import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor;
44.55 +import org.openide.awt.DynamicMenuContent;
44.56 +import org.openide.nodes.Node;
44.57 +import org.openide.util.HelpCtx;
44.58 +import org.openide.util.NbBundle;
44.59 +import org.openide.util.Utilities;
44.60 +import org.openide.util.actions.Presenter;
44.61 +
44.62 +/**
44.63 + *
44.64 + * @author mtishkov
44.65 + */
44.66 +
44.67 +public class MoreBuildActionsAction extends MakeProjectContextAwareAction implements Presenter.Menu, Presenter.Popup {
44.68 + private JMenu subMenu = null;
44.69 + private Project project;
44.70 +
44.71 +
44.72 + @Override
44.73 + protected void performAction(Node[] activatedNodes) {
44.74 +
44.75 + }
44.76 +
44.77 +
44.78 + @Override
44.79 + protected boolean enable(Node[] activatedNodes) {
44.80 + //get
44.81 + project = getProject(activatedNodes);
44.82 + if (project == null) {
44.83 + return false;
44.84 + }
44.85 + ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
44.86 + if (pdp == null) {
44.87 + return false;
44.88 + }
44.89 + return true;
44.90 + }
44.91 +
44.92 +
44.93 +
44.94 + @Override
44.95 + public HelpCtx getHelpCtx() {
44.96 + //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
44.97 + return null;
44.98 + }
44.99 +
44.100 +
44.101 +
44.102 + @Override
44.103 + public JMenuItem getPopupPresenter() {
44.104 + createSubMenu();
44.105 + return subMenu;
44.106 + }
44.107 +
44.108 + @Override
44.109 + public JMenuItem getMenuPresenter() {
44.110 + createSubMenu();
44.111 + return subMenu;
44.112 + }
44.113 +
44.114 + private ArrayList<Action> getActions() {
44.115 + ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
44.116 + if (pdp == null) {
44.117 + return null;
44.118 + }
44.119 + MakeConfigurationDescriptor descriptor = pdp.getConfigurationDescriptor();
44.120 + MakeConfiguration active = (descriptor == null) ? null : descriptor.getActiveConfiguration();
44.121 + ArrayList<Action> actionsList = new ArrayList<Action>();
44.122 + boolean isDiskFolder = descriptor == null || active == null || active.isMakefileConfiguration();
44.123 + actionsList.addAll(Utilities.actionsForPath("Projects/org-netbeans-modules-cnd-makeproject/MoreBuildActions"));//NOI18N
44.124 + actionsList.addAll(Utilities.actionsForPath("CND/Actions/MoreBuildCommands/" + (isDiskFolder ? "DiskFolder" : "LogicalFolder")));//NOI18N
44.125 + return actionsList;
44.126 + }
44.127 +
44.128 + private void createSubMenu() {
44.129 + if (subMenu == null) {
44.130 + String label = NbBundle.getMessage(MoreBuildActionsAction.class, "LBL_MoreBuildActionsAction_Name"); // NOI18N
44.131 + subMenu = new JMenu(label);
44.132 + ArrayList<Action> actions = getActions();
44.133 + if (actions == null) {
44.134 + return;
44.135 + }
44.136 + for (Action action : actions) {
44.137 + //do now show if disabled and property Hide when Disable is set to TRUE
44.138 + if (Boolean.TRUE.equals(action.getValue(DynamicMenuContent.HIDE_WHEN_DISABLED)) && !action.isEnabled()) {
44.139 + continue;
44.140 + }
44.141 + subMenu.add(action);
44.142 + }
44.143 + }
44.144 + }
44.145 +
44.146 + @Override
44.147 + public String getName() {
44.148 + return NbBundle.getMessage(MoreBuildActionsAction.class, "LBL_MoreBuildActionsAction_Name");//NOI18N
44.149 + }
44.150 +}
45.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/Bundle.properties Tue Feb 19 16:39:13 2013 +0100
45.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/Bundle.properties Wed Feb 20 15:23:50 2013 +0100
45.3 @@ -53,6 +53,7 @@
45.4 LBL_COMMAND_LINE=Command Line
45.5 LBL_Config_Custom_Build=Custom Build Step
45.6 LBL_MAKE_NODE=Make
45.7 +LBL_COMPILE_NODE=Compile
45.8 LBL_REQUIRED_PROJECTS_NODE=Related Projects
45.9 LBL_CCPP_NODE=C/C++
45.10 LBL_CCPPFORTRAN_NODE=C/C++/Fortran
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/CompileCustomizerNode.java Wed Feb 20 15:23:50 2013 +0100
46.3 @@ -0,0 +1,70 @@
46.4 +/*
46.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
46.6 + *
46.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
46.8 + *
46.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
46.10 + * Other names may be trademarks of their respective owners.
46.11 + *
46.12 + * The contents of this file are subject to the terms of either the GNU
46.13 + * General Public License Version 2 only ("GPL") or the Common
46.14 + * Development and Distribution License("CDDL") (collectively, the
46.15 + * "License"). You may not use this file except in compliance with the
46.16 + * License. You can obtain a copy of the License at
46.17 + * http://www.netbeans.org/cddl-gplv2.html
46.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
46.19 + * specific language governing permissions and limitations under the
46.20 + * License. When distributing the software, include this License Header
46.21 + * Notice in each file and include the License file at
46.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
46.23 + * particular file as subject to the "Classpath" exception as provided
46.24 + * by Oracle in the GPL Version 2 section of the License file that
46.25 + * accompanied this code. If applicable, add the following below the
46.26 + * License Header, with the fields enclosed by brackets [] replaced by
46.27 + * your own identifying information:
46.28 + * "Portions Copyrighted [year] [name of copyright owner]"
46.29 + *
46.30 + * If you wish your version of this file to be governed by only the CDDL
46.31 + * or only the GPL Version 2, indicate your decision by adding
46.32 + * "[Contributor] elects to include this software in this distribution
46.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
46.34 + * single choice of license, a recipient has the option to distribute
46.35 + * your version of this file under either the CDDL, the GPL Version 2 or
46.36 + * to extend the choice of license to its licensees as provided above.
46.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
46.38 + * Version 2 license, then the option applies only if the new code is
46.39 + * made subject to such option by the copyright holder.
46.40 + *
46.41 + * Contributor(s):
46.42 + *
46.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
46.44 + */
46.45 +package org.netbeans.modules.cnd.makeproject.ui.customizer;
46.46 +
46.47 +import org.netbeans.modules.cnd.makeproject.api.configurations.Configuration;
46.48 +import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
46.49 +import org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerNode;
46.50 +import org.openide.nodes.Sheet;
46.51 +import org.openide.util.HelpCtx;
46.52 +import org.openide.util.Lookup;
46.53 +
46.54 +/**
46.55 + *
46.56 + * @author Alexander Simon
46.57 + */
46.58 +public class CompileCustomizerNode extends CustomizerNode {
46.59 +
46.60 + public CompileCustomizerNode(String name, String displayName, CustomizerNode[] children, Lookup lookup) {
46.61 + super(name, displayName, children, lookup);
46.62 + }
46.63 +
46.64 + @Override
46.65 + public Sheet getSheet(Configuration configuration) {
46.66 + return ((MakeConfiguration) configuration).getCompileConfiguration().getSheet();
46.67 + }
46.68 +
46.69 + @Override
46.70 + public HelpCtx getHelpCtx() {
46.71 + return new HelpCtx("ProjectPropsMake"); // NOI18N
46.72 + }
46.73 +}
47.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/MakeCustomizer.java Tue Feb 19 16:39:13 2013 +0100
47.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/MakeCustomizer.java Wed Feb 20 15:23:50 2013 +0100
47.3 @@ -726,12 +726,14 @@
47.4 public Configuration addAction() {
47.5 String newName = ConfigurationSupport.getUniqueNewName(getConfs());
47.6 int type = MakeConfiguration.TYPE_MAKEFILE;
47.7 + String customizerId = null;
47.8 String buildDir = null;
47.9 if (getActive() != null) {
47.10 type = ((MakeConfiguration) getActive()).getConfigurationType().getValue();
47.11 + customizerId = ((MakeConfiguration) getActive()).getCustomizerId();
47.12 buildDir = ((MakeConfiguration) getActive()).getMakefileConfiguration().getBuildCommandWorkingDirValue();
47.13 }
47.14 - Configuration newconf = projectDescriptor.defaultConf(newName, type);
47.15 + Configuration newconf = projectDescriptor.defaultConf(newName, type, customizerId);
47.16 if (buildDir != null) {
47.17 ((MakeConfiguration) newconf).getMakefileConfiguration().getBuildCommandWorkingDir().setValue(buildDir);
47.18 }
48.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/ProjectNodeFactory.java Tue Feb 19 16:39:13 2013 +0100
48.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/customizer/ProjectNodeFactory.java Wed Feb 20 15:23:50 2013 +0100
48.3 @@ -177,6 +177,7 @@
48.4 ArrayList<CustomizerNode> descriptions = new ArrayList<CustomizerNode>();
48.5 if (includeMakefileDescription) {
48.6 descriptions.add(createMakefileDescription(lookup));
48.7 + descriptions.add(createCompileDescription(lookup));
48.8 }
48.9 if (includeQtDescription) {
48.10 descriptions.add(createQtDescription(lookup));
48.11 @@ -205,6 +206,12 @@
48.12 "Make", getString("LBL_MAKE_NODE"), null, lookup); // NOI18N
48.13 }
48.14
48.15 + // Compile Node
48.16 + private static CustomizerNode createCompileDescription(Lookup lookup) {
48.17 + return new CompileCustomizerNode(
48.18 + "Compile", getString("LBL_COMPILE_NODE"), null, lookup); // NOI18N
48.19 + }
48.20 +
48.21 // C/C++/Fortran Node
48.22 private static ArrayList<CustomizerNode> createCompilerNodes(Lookup lookup) {
48.23 MakeContext context = lookup.lookup(MakeContext.class);
49.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/resources/layer.xml Tue Feb 19 16:39:13 2013 +0100
49.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/resources/layer.xml Wed Feb 20 15:23:50 2013 +0100
49.3 @@ -274,13 +274,13 @@
49.4 <folder name="Actions">
49.5 <folder name="Project">
49.6 <!-- Project operations -->
49.7 - <file name="org-netbeans-modules-cnd-makeproject-actions-AddExistingItemAction.instance">
49.8 + <file name="org-netbeans-modules-cnd-makeproject-api-actions-AddExistingItemAction.instance">
49.9 <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.api.actions.AddExistingItemAction"/>
49.10 </file>
49.11 <file name="org-netbeans-modules-cnd-makeproject-actions-AddExistingFolderItemsAction.instance">
49.12 <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.actions.AddExistingFolderItemsAction"/>
49.13 </file>
49.14 - <file name="org-netbeans-modules-cnd-makeproject-actions-NewFolderAction.instance">
49.15 + <file name="org-netbeans-modules-cnd-makeproject-api-actions-NewFolderAction.instance">
49.16 <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.api.actions.NewFolderAction"/>
49.17 </file>
49.18 <file name="org-netbeans-modules-cnd-makeproject-actions-RunTestAction.instance">
49.19 @@ -298,6 +298,36 @@
49.20 <file name="org-netbeans-modules-cnd-makeproject-actions-ConfigurationManagerAction.instance">
49.21 <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.actions.ConfigurationManagerAction"/>
49.22 </file>
49.23 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-MoreBuildActionsAction.instance">
49.24 + <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MoreBuildActionsAction"/>
49.25 + </file>
49.26 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-MakeProjectConfigurationAction.instance">
49.27 + <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MakeProjectConfigurationAction"/>
49.28 + </file>
49.29 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-MakeProjectBuildHostAction.instance">
49.30 + <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MakeProjectBuildHostAction"/>
49.31 + </file>
49.32 + <file name="org-netbeans-modules-cnd-makeproject-ui-UploadAction.instance">
49.33 + <attr name="instanceCreate" methodvalue="org.netbeans.modules.cnd.makeproject.ui.RemoteSyncActions.createUploadAction"/>
49.34 + </file>
49.35 + <file name="org-netbeans-modules-cnd-makeproject-ui-DownloadAction.instance">
49.36 + <attr name="instanceCreate" methodvalue="org.netbeans.modules.cnd.makeproject.ui.RemoteSyncActions.createDownloadAction"/>
49.37 + </file>
49.38 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-BatchBuildProject.instance">
49.39 + <attr name="instanceCreate" methodvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MakeProjectActionsSupport.batchBuildAction"/>
49.40 + </file>
49.41 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-BuildPackageAction.instance">
49.42 + <attr name="instanceClass" stringvalue="org.netbeans.modules.cnd.makeproject.ui.actions.BuildPackageAction"/>
49.43 + </file>
49.44 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-DebugAction.instance">
49.45 + <attr name="instanceCreate" methodvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MakeProjectActionsSupport.debugAction"/>
49.46 + </file>
49.47 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-StepIntoAction.instance">
49.48 + <attr name="instanceCreate" methodvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MakeProjectActionsSupport.stepIntoAction"/>
49.49 + </file>
49.50 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-TestAction.instance">
49.51 + <attr name="instanceCreate" methodvalue="org.netbeans.modules.cnd.makeproject.ui.actions.MakeProjectActionsSupport.testAction"/>
49.52 + </file>
49.53 </folder>
49.54 <folder name="Tools">
49.55 <file name="org-netbeans-modules-cnd-makeproject-actions-TestSubmenuAction.instance">
49.56 @@ -697,10 +727,155 @@
49.57 <folder name="Projects">
49.58 <!-- MakeProject Extension Points-->
49.59 <folder name="org-netbeans-modules-cnd-makeproject">
49.60 + <folder name="MoreBuildActions">
49.61 + <file name="org-netbeans-modules-project-ui-CleanProject.shadow">
49.62 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-CleanProject.instance"/>
49.63 + <attr name="position" intvalue="100"/>
49.64 + </file>
49.65 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-BatchBuildProject.shadow">
49.66 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-BatchBuildProject.instance"/>
49.67 + <attr name="position" intvalue="200"/>
49.68 + </file>
49.69 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-BuildPackageAction.shadow">
49.70 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-BuildPackageAction.instance"/>
49.71 + <attr name="position" intvalue="300"/>
49.72 + </file>
49.73 + </folder>
49.74 +
49.75 <folder name="Nodes"/>
49.76 <folder name="ImportantFiles"/>
49.77 <folder name="Customizer"/>
49.78 - <folder name="Actions"/>
49.79 + <folder name="Actions">
49.80 + <file name="org-netbeans-modules-project-ui-NewFile$WithSubMenu.shadow">
49.81 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewFile$WithSubMenu.instance"/>
49.82 + <attr name="position" intvalue="100"/>
49.83 + </file>
49.84 + <file name="sep-1.instance">
49.85 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.86 + <attr name="position" intvalue="200"/>
49.87 + </file>
49.88 + <file name="org-netbeans-modules-cnd-makeproject-api-actions-AddExistingItemAction.shadow">
49.89 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-api-actions-AddExistingItemAction.instance"/>
49.90 + <attr name="position" intvalue="300"/>
49.91 + </file>
49.92 + <file name="org-netbeans-modules-cnd-makeproject-actions-AddExistingFolderItemsAction.shadow">
49.93 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-actions-AddExistingFolderItemsAction.instance"/>
49.94 + <attr name="position" intvalue="400"/>
49.95 + </file>
49.96 + <file name="org-netbeans-modules-cnd-makeproject-api-actions-NewFolderAction.shadow">
49.97 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-api-actions-NewFolderAction.instance"/>
49.98 + <attr name="position" intvalue="500"/>
49.99 + </file>
49.100 + <file name="sep-1.1.instance">
49.101 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.102 + <attr name="position" intvalue="600"/>
49.103 + </file>
49.104 + <file name="org-netbeans-modules-project-ui-BuildProject.shadow">
49.105 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-BuildProject.instance"/>
49.106 + <attr name="position" intvalue="700"/>
49.107 + </file>
49.108 + <file name="org-netbeans-modules-project-ui-RebuildProject.shadow">
49.109 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RebuildProject.instance"/>
49.110 + <attr name="position" intvalue="800"/>
49.111 + </file>
49.112 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-MoreBuildActionsAction.shadow">
49.113 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-MoreBuildActionsAction.instance"/>
49.114 + <attr name="position" intvalue="900"/>
49.115 + </file>
49.116 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-MakeProjectConfigurationAction.shadow">
49.117 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-MakeProjectConfigurationAction.instance"/>
49.118 + <attr name="position" intvalue="1000"/>
49.119 + </file>
49.120 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-MakeProjectBuildHostAction.shadow">
49.121 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-MakeProjectBuildHostAction.instance"/>
49.122 + <attr name="position" intvalue="1100"/>
49.123 + </file>
49.124 + <file name="org-netbeans-modules-cnd-makeproject-ui-UploadAction.shadow">
49.125 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-UploadAction.instance"/>
49.126 + <attr name="position" intvalue="1120"/>
49.127 + </file>
49.128 + <file name="org-netbeans-modules-cnd-makeproject-ui-DownloadAction.shadow">
49.129 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-DownloadAction.instance"/>
49.130 + <attr name="position" intvalue="1130"/>
49.131 + </file>
49.132 +
49.133 + <file name="sep-2.instance">
49.134 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.135 + <attr name="position" intvalue="1200"/>
49.136 + </file>
49.137 + <file name="org-netbeans-modules-project-ui-RunProject.shadow">
49.138 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RunProject.instance"/>
49.139 + <attr name="position" intvalue="1300"/>
49.140 + </file>
49.141 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-DebugAction.shadow">
49.142 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-DebugAction.instance"/>
49.143 + <attr name="position" intvalue="1400"/>
49.144 + </file>
49.145 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-StepIntoAction.shadow">
49.146 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-StepIntoAction.instance"/>
49.147 + <attr name="position" intvalue="1500"/>
49.148 + </file>
49.149 + <file name="org-netbeans-modules-cnd-makeproject-ui-actions-TestAction.shadow">
49.150 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-cnd-makeproject-ui-actions-TestAction.instance"/>
49.151 + <attr name="position" intvalue="1600"/>
49.152 + </file>
49.153 + <file name="sep-3.instance">
49.154 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.155 + <attr name="position" intvalue="1700"/>
49.156 + </file>
49.157 + <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
49.158 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
49.159 + <attr name="position" intvalue="1800"/>
49.160 + </file>
49.161 + <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
49.162 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
49.163 + <attr name="position" intvalue="1900"/>
49.164 + </file>
49.165 + <file name="org-netbeans-modules-project-ui-CloseProject.shadow">
49.166 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-CloseProject.instance"/>
49.167 + <attr name="position" intvalue="2000"/>
49.168 + </file>
49.169 + <file name="sep-4.instance">
49.170 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.171 + <attr name="position" intvalue="2100"/>
49.172 + </file>
49.173 + <file name="org-netbeans-modules-project-ui-RenameProject.shadow">
49.174 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RenameProject.instance"/>
49.175 + <attr name="position" intvalue="2200"/>
49.176 + </file>
49.177 + <file name="org-netbeans-modules-project-ui-MoveProject.shadow">
49.178 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-MoveProject.instance"/>
49.179 + <attr name="position" intvalue="2300"/>
49.180 + </file>
49.181 + <file name="org-netbeans-modules-project-ui-CopyProject.shadow">
49.182 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-CopyProject.instance"/>
49.183 + <attr name="position" intvalue="2400"/>
49.184 + </file>
49.185 + <file name="org-netbeans-modules-project-ui-DeleteProject.shadow">
49.186 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DeleteProject.instance"/>
49.187 + <attr name="position" intvalue="2500"/>
49.188 + </file>
49.189 + <file name="sep-5.instance">
49.190 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.191 + <attr name="position" intvalue="2600"/>
49.192 + </file>
49.193 + <file name="org-openide-actions-FindAction.shadow">
49.194 + <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-FindAction.instance"/>
49.195 + <attr name="position" intvalue="2700"/>
49.196 + </file>
49.197 + <file name="general.shadow">
49.198 + <attr name="originalFile" stringvalue="Projects/Actions"/>
49.199 + <attr name="position" intvalue="2800"/>
49.200 + </file>
49.201 + <file name="sep-6.instance">
49.202 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
49.203 + <attr name="position" intvalue="2900"/>
49.204 + </file>
49.205 + <file name="org-netbeans-modules-project-ui-CustomizeProject.shadow">
49.206 + <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-CustomizeProject.instance"/>
49.207 + <attr name="position" intvalue="3000"/>
49.208 + </file>
49.209 + </folder>
49.210 <folder name="ActionsFolder"/>
49.211 <folder name="ActionsExtFolder"/>
49.212 <folder name="Lookup">
50.1 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/NewMakeProjectWizardIterator.java Tue Feb 19 16:39:13 2013 +0100
50.2 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/NewMakeProjectWizardIterator.java Wed Feb 20 15:23:50 2013 +0100
50.3 @@ -411,7 +411,7 @@
50.4 String template = (String) wiz.getProperty("mainFileTemplate"); // NOI18N
50.5 mainFile = fname + "|" + template; // NOI18N
50.6 }
50.7 - MakeConfiguration debug = new MakeConfiguration(dirF.getPath(), "Debug", conftype, hostUID, toolchain, defaultToolchain); // NOI18N
50.8 + MakeConfiguration debug = MakeConfiguration.createConfiguration(dirF, "Debug", conftype, null, hostUID, toolchain, defaultToolchain); // NOI18N
50.9 debug.getCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_DEBUG);
50.10 debug.getCCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_DEBUG);
50.11 debug.getFortranCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_DEBUG);
50.12 @@ -423,7 +423,7 @@
50.13 provider.setupReleaseConfiguration(debug);
50.14 }
50.15 }
50.16 - MakeConfiguration release = new MakeConfiguration(dirF.getPath(), "Release", conftype, hostUID, toolchain, defaultToolchain); // NOI18N
50.17 + MakeConfiguration release = MakeConfiguration.createConfiguration(dirF, "Release", conftype, null, hostUID, toolchain, defaultToolchain); // NOI18N
50.18 release.getCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_RELEASE);
50.19 release.getCCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_RELEASE);
50.20 release.getFortranCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_RELEASE);
51.1 --- a/cnd.makeproject/test/unit/src/org/netbeans/modules/cnd/makeproject/RunCommandTest.java Tue Feb 19 16:39:13 2013 +0100
51.2 +++ b/cnd.makeproject/test/unit/src/org/netbeans/modules/cnd/makeproject/RunCommandTest.java Wed Feb 20 15:23:50 2013 +0100
51.3 @@ -67,7 +67,7 @@
51.4
51.5 File folderBase = getBaseFolder();
51.6 final FileObject folderBaseFO = CndFileUtils.toFileObject(folderBase);
51.7 - conf = new MakeConfiguration(FSPath.toFSPath(folderBaseFO), "Default", MakeConfiguration.TYPE_APPLICATION); // NOI18N
51.8 + conf = MakeConfiguration.createConfiguration(FSPath.toFSPath(folderBaseFO), "Default", MakeConfiguration.TYPE_APPLICATION, null, null); // NOI18N
51.9 }
51.10
51.11 private static File getBaseFolder(){
52.1 --- a/cnd.makeproject/test/unit/src/org/netbeans/modules/cnd/makeproject/api/configurations/QmakeConfigurationTest.java Tue Feb 19 16:39:13 2013 +0100
52.2 +++ b/cnd.makeproject/test/unit/src/org/netbeans/modules/cnd/makeproject/api/configurations/QmakeConfigurationTest.java Wed Feb 20 15:23:50 2013 +0100
52.3 @@ -54,6 +54,8 @@
52.4 import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory;
52.5 import org.openide.util.Utilities;
52.6 import static org.junit.Assert.*;
52.7 +import org.netbeans.modules.cnd.utils.FSPath;
52.8 +import org.netbeans.modules.cnd.utils.cache.CndFileUtils;
52.9
52.10 /**
52.11 * @author Alexey Vladykin
52.12 @@ -79,7 +81,7 @@
52.13
52.14 private static QmakeConfiguration newQmakeConfiguration(int confType) {
52.15 File dir = new File(System.getProperty("java.io.tmpdir"), "QmakeConfigurationTest");
52.16 - MakeConfiguration conf = new MakeConfiguration(dir.getPath(), "Dummy", confType);
52.17 + MakeConfiguration conf = MakeConfiguration.createConfiguration(new FSPath(CndFileUtils.getLocalFileSystem(), dir.getPath()), "Dummy", confType, null, null);
52.18 //++ trace for #194772 - QmakeConfigurationTest fails on Windows and Mac
52.19 Platform platform = Platforms.getPlatform(conf.getDevelopmentHost().getBuildPlatform());
52.20 System.out.println("Creating QmakeConfiguration for platform " + platform.getDisplayName());
53.1 --- a/cnd.makeproject/test/unit/src/org/netbeans/modules/cnd/makeproject/configurations/ConfigurationMakefileWriterTest.java Tue Feb 19 16:39:13 2013 +0100
53.2 +++ b/cnd.makeproject/test/unit/src/org/netbeans/modules/cnd/makeproject/configurations/ConfigurationMakefileWriterTest.java Wed Feb 20 15:23:50 2013 +0100
53.3 @@ -125,7 +125,7 @@
53.4 File folderBase = getBaseFolder();
53.5 final FileObject folderBaseFO = CndFileUtils.toFileObject(folderBase);
53.6 MakeConfigurationDescriptor makeConfigurationDescriptor = new MakeConfigurationDescriptor(folderBaseFO);
53.7 - MakeConfiguration conf = new MakeConfiguration(FSPath.toFSPath(folderBaseFO), "Default", MakeConfiguration.TYPE_APPLICATION); // NOI18N
53.8 + MakeConfiguration conf = MakeConfiguration.createConfiguration(FSPath.toFSPath(folderBaseFO), "Default", MakeConfiguration.TYPE_APPLICATION, null, null); // NOI18N
53.9 makeConfigurationDescriptor.init(conf);
53.10 makeConfigurationDescriptor.getLogicalFolders().addItem(Item.createInFileSystem(makeConfigurationDescriptor.getBaseDirFileSystem(), "test.cc"));
53.11 LibraryItem.ProjectItem projectItem;
53.12 @@ -264,7 +264,7 @@
53.13 File folderBase = getBaseFolder();
53.14 final FileObject folderBaseFO = CndFileUtils.toFileObject(folderBase);
53.15 MakeConfigurationDescriptor makeConfigurationDescriptor = new MakeConfigurationDescriptor(folderBaseFO);
53.16 - MakeConfiguration conf = new MakeConfiguration(FSPath.toFSPath(folderBaseFO), "Default", MakeConfiguration.TYPE_DYNAMIC_LIB); // NOI18N
53.17 + MakeConfiguration conf =MakeConfiguration.createConfiguration(FSPath.toFSPath(folderBaseFO), "Default", MakeConfiguration.TYPE_DYNAMIC_LIB, null, null); // NOI18N
53.18 makeConfigurationDescriptor.init(conf);
53.19 makeConfigurationDescriptor.getLogicalFolders().addItem(Item.createInFileSystem(makeConfigurationDescriptor.getBaseDirFileSystem(), "test.cc"));
53.20
54.1 --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/content/file/FileContent.java Tue Feb 19 16:39:13 2013 +0100
54.2 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/content/file/FileContent.java Wed Feb 20 15:23:50 2013 +0100
54.3 @@ -73,6 +73,7 @@
54.4 import org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl;
54.5 import org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase;
54.6 import org.netbeans.modules.cnd.modelimpl.debug.TraceFlags;
54.7 +import org.netbeans.modules.cnd.modelimpl.parser.spi.CsmParserProvider;
54.8 import org.netbeans.modules.cnd.modelimpl.repository.FileDeclarationsKey;
54.9 import org.netbeans.modules.cnd.modelimpl.repository.FileIncludesKey;
54.10 import org.netbeans.modules.cnd.modelimpl.repository.FileInstantiationsKey;
54.11 @@ -101,7 +102,7 @@
54.12 private final List<FakeIncludePair> fakeIncludeRegistrations;
54.13 private final List<CsmUID<FunctionImplEx<?>>> fakeFunctionRegistrations;
54.14 private int parserErrorsCount;
54.15 - private final Set<ErrorDirectiveImpl> errors;
54.16 + private final Set<ErrorDirectiveImpl> errors;
54.17 private final Union2<FileComponentDeclarations, WeakContainer<FileComponentDeclarations>> fileComponentDeclarations;
54.18 /*FileComponentMacros or WeakContainer<FileComponentMacros>*/
54.19 private final Union2<FileComponentMacros, WeakContainer<FileComponentMacros>> fileComponentMacros;
54.20 @@ -112,7 +113,8 @@
54.21 private final Union2<FileComponentInstantiations, WeakContainer<FileComponentInstantiations>> fileComponentInstantiations;
54.22 /*FileComponentReferences or WeakContainer<FileComponentReferences>*/
54.23 private final Union2<FileComponentReferences, WeakContainer<FileComponentReferences>> fileComponentReferences;
54.24 -
54.25 + private final Collection<CsmParserProvider.ParserError> parserErrors;
54.26 +
54.27 public static FileContent createFileContent(FileImpl fileImpl, ProjectBase project) {
54.28 return new FileContent(fileImpl, project, true,
54.29 new FileComponentDeclarations(fileImpl),
54.30 @@ -123,7 +125,8 @@
54.31 new FileComponentReferences(fileImpl),
54.32 createFakeIncludes(Collections.<FakeIncludePair>emptyList()),
54.33 createFakeFunctions(Collections.<CsmUID<FunctionImplEx<?>>>emptyList()),
54.34 - createErrors(Collections.<ErrorDirectiveImpl>emptySet()), 0);
54.35 + createErrors(Collections.<ErrorDirectiveImpl>emptySet()), 0,
54.36 + createParserErrors(Collections.<CsmParserProvider.ParserError>emptyList()));
54.37 }
54.38
54.39 private FileContent(FileImpl fileImpl, ProjectBase project, boolean persistent,
54.40 @@ -132,7 +135,8 @@
54.41 FileComponentInstantiations fcinst, FileComponentReferences fcr,
54.42 List<FakeIncludePair> fakeIncludeRegistrations,
54.43 List<CsmUID<FunctionImplEx<?>>> fakeFunctionRegistrations,
54.44 - Set<ErrorDirectiveImpl> errors, int parserErrorsCount) {
54.45 + Set<ErrorDirectiveImpl> errors, int parserErrorsCount,
54.46 + Collection<CsmParserProvider.ParserError> parserErrors) {
54.47 this.persistent = persistent;
54.48 this.fileImpl = fileImpl;
54.49 this.fileComponentDeclarations = asUnion(project, fcd, persistent);
54.50 @@ -145,6 +149,7 @@
54.51 this.fakeFunctionRegistrations = fakeFunctionRegistrations;
54.52 this.errors = errors;
54.53 this.parserErrorsCount = parserErrorsCount;
54.54 + this.parserErrors = parserErrors;
54.55 if (persistent) {
54.56 fcd.put();
54.57 fcm.put();
54.58 @@ -180,7 +185,8 @@
54.59 createFakeIncludes(emptyContent ? Collections.<FakeIncludePair>emptyList() : other.fakeIncludeRegistrations),
54.60 createFakeFunctions(emptyContent ? Collections.<CsmUID<FunctionImplEx<?>>>emptyList() : other.fakeFunctionRegistrations),
54.61 createErrors(emptyContent ? Collections.<ErrorDirectiveImpl>emptySet() : other.errors),
54.62 - emptyContent ? 0 : other.parserErrorsCount);
54.63 + emptyContent ? 0 : other.parserErrorsCount,
54.64 + createParserErrors(emptyContent ? Collections.<CsmParserProvider.ParserError>emptyList() : other.parserErrors));
54.65 }
54.66
54.67 /**
54.68 @@ -199,7 +205,8 @@
54.69 this.getFileInstantiations(), this.getFileReferences(),
54.70 this.fakeIncludeRegistrations,
54.71 this.fakeFunctionRegistrations,
54.72 - this.errors, this.parserErrorsCount);
54.73 + this.errors, this.parserErrorsCount,
54.74 + this.parserErrors);
54.75 } finally {
54.76 // mark object as no more usable
54.77 this.parserErrorsCount = -1;
54.78 @@ -287,6 +294,10 @@
54.79 traceAddRemove("ERROR", error); // NOI18N
54.80 errors.add(error);
54.81 }
54.82 +
54.83 + public void addParsingError(CsmParserProvider.ParserError error) {
54.84 + parserErrors.add(error);
54.85 + }
54.86
54.87 public void addMacro(CsmMacro macro) {
54.88 checkValid();
54.89 @@ -387,6 +398,12 @@
54.90 out.addAll(in);
54.91 return out;
54.92 }
54.93 +
54.94 + private static Collection<CsmParserProvider.ParserError> createParserErrors(Collection<CsmParserProvider.ParserError> in) {
54.95 + Collection<CsmParserProvider.ParserError> out = new ArrayList<CsmParserProvider.ParserError>();
54.96 + out.addAll(in);
54.97 + return out;
54.98 + }
54.99
54.100 public FileComponentDeclarations getFileDeclarations() {
54.101 checkValid();
54.102 @@ -398,6 +415,10 @@
54.103 return Collections.unmodifiableSet(errors);
54.104 }
54.105
54.106 + public Collection<CsmParserProvider.ParserError> getParserErrors() {
54.107 + return Collections.unmodifiableCollection(parserErrors);
54.108 + }
54.109 +
54.110 public FileComponentMacros getFileMacros() {
54.111 checkValid();
54.112 return getFileComponent(fileComponentMacros);
54.113 @@ -469,6 +490,8 @@
54.114
54.115 FakeIncludePair.write(fakeIncludeRegistrations, output);
54.116 UIDObjectFactory.getDefaultFactory().writeUIDCollection(this.fakeFunctionRegistrations, output, false);
54.117 +
54.118 + // TODO : store parser errors
54.119 }
54.120
54.121 public FileContent(FileImpl file, ProjectBase project, RepositoryDataInput input) throws IOException {
54.122 @@ -505,6 +528,9 @@
54.123 this.fakeFunctionRegistrations = createFakeFunctions(Collections.<CsmUID<FunctionImplEx<?>>>emptyList());
54.124 UIDObjectFactory.getDefaultFactory().readUIDCollection(this.fakeFunctionRegistrations, input);
54.125
54.126 + this.parserErrors = createParserErrors(Collections.<CsmParserProvider.ParserError>emptyList());
54.127 + // TODO : load parser errors
54.128 +
54.129 checkValid();
54.130 }
54.131
55.1 --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/FileImpl.java Tue Feb 19 16:39:13 2013 +0100
55.2 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/FileImpl.java Wed Feb 20 15:23:50 2013 +0100
55.3 @@ -1439,19 +1439,6 @@
55.4 assert parser != null : "no parser for " + this;
55.5
55.6 parser.init(this, filteredTokenStream, parseParams.callback);
55.7 - if(TraceFlags.CPP_PARSER_NEW_GRAMMAR) {
55.8 - if(parsingErrors == null) {
55.9 - parsingErrors = new ArrayList<ParserError>();
55.10 - }
55.11 - parsingErrors.clear();
55.12 - CsmParserProvider.ParserErrorDelegate delegate = new CsmParserProvider.ParserErrorDelegate() {
55.13 - @Override
55.14 - public void onError(ParserError e) {
55.15 - parsingErrors.add(e);
55.16 - }
55.17 - };
55.18 - parser.setErrorDelegate(delegate);
55.19 - }
55.20
55.21 parseResult = parser.parse(parseParams.lazyCompound ? CsmParser.ConstructionKind.TRANSLATION_UNIT : CsmParser.ConstructionKind.TRANSLATION_UNIT_WITH_COMPOUND);
55.22 FilePreprocessorConditionState pcState = pcBuilder.build();
55.23 @@ -1523,11 +1510,29 @@
55.24 currentFileContent = fileContent.toWeakReferenceBasedCopy();
55.25 currentFileContent.put();
55.26 RepositoryUtils.put(this);
55.27 + if(TraceFlags.CPP_PARSER_NEW_GRAMMAR) {
55.28 + if(parsingErrors == null) {
55.29 + parsingErrors = new ArrayList<ParserError>();
55.30 + }
55.31 + parsingErrors.clear();
55.32 + if(currentFileContent != null) {
55.33 + parsingErrors.addAll(currentFileContent.getParserErrors());
55.34 + }
55.35 + }
55.36 if (TraceFlags.PARSE_HEADERS_WITH_SOURCES) {
55.37 for (FileContent includedFileContent : fileContent.getIncludedFileContents()) {
55.38 FileImpl fileImplIncluded = includedFileContent.getFile();
55.39 fileImplIncluded.updateModelAfterParsing(includedFileContent);
55.40 fileImplIncluded.parsingFileContentRef.get().set(null);
55.41 + if(TraceFlags.CPP_PARSER_NEW_GRAMMAR) {
55.42 + if(fileImplIncluded.parsingErrors == null) {
55.43 + fileImplIncluded.parsingErrors = new ArrayList<ParserError>();
55.44 + }
55.45 + fileImplIncluded.parsingErrors.clear();
55.46 + if(includedFileContent != null) {
55.47 + fileImplIncluded.parsingErrors.addAll(includedFileContent.getParserErrors());
55.48 + }
55.49 + }
55.50 synchronized (fileImplIncluded.changeStateLock) {
55.51 fileImplIncluded.state = State.PARSED;
55.52 }
56.1 --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/CXXParserActionImpl.java Tue Feb 19 16:39:13 2013 +0100
56.2 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/CXXParserActionImpl.java Wed Feb 20 15:23:50 2013 +0100
56.3 @@ -58,6 +58,10 @@
56.4 public CXXParserActionImpl(CsmParserProvider.CsmParserParameters params) {
56.5 orig = new CppParserActionImpl(params, this);
56.6 }
56.7 +
56.8 + public void setParser(CXXParserEx parser) {
56.9 + orig.setParser(parser);
56.10 + }
56.11
56.12 @Override
56.13 public boolean type_specifier_already_present(TokenStream input) {
57.1 --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/CppParserActionImpl.java Tue Feb 19 16:39:13 2013 +0100
57.2 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/CppParserActionImpl.java Wed Feb 20 15:23:50 2013 +0100
57.3 @@ -125,6 +125,7 @@
57.4 import org.netbeans.modules.cnd.modelimpl.csm.deep.UniversalStatement.UniversalStatementBuilder;
57.5 import org.netbeans.modules.cnd.modelimpl.parser.generated.CPPTokenTypes;
57.6 import org.netbeans.modules.cnd.modelimpl.parser.spi.CsmParserProvider;
57.7 +import org.netbeans.modules.cnd.modelimpl.parser.spi.CsmParserProvider.ParserError;
57.8 import org.netbeans.modules.cnd.modelimpl.parser.symtab.*;
57.9 import org.openide.util.CharSequences;
57.10
57.11 @@ -144,6 +145,7 @@
57.12 private final Deque<Pair> contexts;
57.13 private CsmParserProvider.CsmParserParameters params;
57.14 private CXXParserActionEx wrapper;
57.15 + private CXXParserEx parser;
57.16
57.17 private static final class Pair {
57.18 final Map<Integer, CsmObject> objects = new HashMap<Integer, CsmObject>();
57.19 @@ -169,6 +171,17 @@
57.20 this.globalSymTab = createGlobal();
57.21 this.builderContext = new CppParserBuilderContext();
57.22 }
57.23 +
57.24 + public void setParser(CXXParserEx parser) {
57.25 + this.parser = parser;
57.26 + parser.setErrorDelegate(new CsmParserProvider.ParserErrorDelegate() {
57.27 +
57.28 + @Override
57.29 + public void onError(ParserError e) {
57.30 + currentContext.file.getParsingFileContent().addParsingError(e);
57.31 + }
57.32 + });
57.33 + }
57.34
57.35 @Override
57.36 public boolean type_specifier_already_present(TokenStream input) {
58.1 --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/ParserProviderImpl.java Tue Feb 19 16:39:13 2013 +0100
58.2 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/ParserProviderImpl.java Wed Feb 20 15:23:50 2013 +0100
58.3 @@ -389,6 +389,7 @@
58.4 tokens = new Antrl2ToAntlr3TokenStreamAdapter(tb);
58.5 }
58.6 parser = new CXXParserEx(tokens, cppCallback);
58.7 + ((CXXParserActionImpl)cppCallback).setParser(parser);
58.8 tokens.setParser(parser);
58.9 }
58.10
59.1 --- a/cnd.modelui/src/org/netbeans/modules/cnd/modelui/layer.xml Tue Feb 19 16:39:13 2013 +0100
59.2 +++ b/cnd.modelui/src/org/netbeans/modules/cnd/modelui/layer.xml Wed Feb 20 15:23:50 2013 +0100
59.3 @@ -96,10 +96,18 @@
59.4 <folder name="Projects">
59.5 <folder name="org-netbeans-modules-cnd-makeproject">
59.6 <folder name="Actions">
59.7 + <file name="sep-6.1.instance">
59.8 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
59.9 + <attr name="position" intvalue="2650"/>
59.10 + </file>
59.11 <file name="org.netbeans.modules.cnd.modelui.switcher.CodeAssistanceSubmenuAction.shadow">
59.12 <attr name="originalFile" stringvalue="Actions/NativeProject/org.netbeans.modules.cnd.modelui.switcher.CodeAssistanceSubmenuAction.instance"/>
59.13 - <attr name="position" intvalue="100"/>
59.14 + <attr name="position" intvalue="2660"/>
59.15 </file>
59.16 + <file name="sep-6.2.instance">
59.17 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
59.18 + <attr name="position" intvalue="2670"/>
59.19 + </file>
59.20 </folder>
59.21 </folder>
59.22 </folder>
60.1 --- a/cnd.remote.projectui/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
60.2 +++ b/cnd.remote.projectui/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
60.3 @@ -72,7 +72,7 @@
60.4 <compile-dependency/>
60.5 <run-dependency>
60.6 <release-version>2</release-version>
60.7 - <specification-version>2.8.4</specification-version>
60.8 + <specification-version>2.36</specification-version>
60.9 </run-dependency>
60.10 </dependency>
60.11 <dependency>
61.1 --- a/cnd.remote.projectui/src/org/netbeans/modules/cnd/remote/projectui/wizard/cnd/Bundle.properties Tue Feb 19 16:39:13 2013 +0100
61.2 +++ b/cnd.remote.projectui/src/org/netbeans/modules/cnd/remote/projectui/wizard/cnd/Bundle.properties Wed Feb 20 15:23:50 2013 +0100
61.3 @@ -94,3 +94,5 @@
61.4 ERROR_RUN_PROJECT_CREATOR=Cannot run Oracle Solaris Studio 12.3 or later on host {0}.
61.5 RUN_PROJECT_CREATOR=Creating project on host {0}...
61.6 CONFIGURING_PROJECT_CREATOR=Configuring project on host {0}...
61.7 +
61.8 +ImportProject.Progress.AnalyzeRoot=Analyze source root...
62.1 --- a/cnd.remote.projectui/src/org/netbeans/modules/cnd/remote/projectui/wizard/cnd/ImportRemoteProject.java Tue Feb 19 16:39:13 2013 +0100
62.2 +++ b/cnd.remote.projectui/src/org/netbeans/modules/cnd/remote/projectui/wizard/cnd/ImportRemoteProject.java Wed Feb 20 15:23:50 2013 +0100
62.3 @@ -52,6 +52,7 @@
62.4 import java.lang.reflect.Method;
62.5 import java.lang.reflect.Type;
62.6 import java.util.ArrayList;
62.7 +import java.util.Collections;
62.8 import java.util.EnumMap;
62.9 import java.util.Enumeration;
62.10 import java.util.HashMap;
62.11 @@ -62,6 +63,7 @@
62.12 import java.util.Set;
62.13 import java.util.StringTokenizer;
62.14 import java.util.WeakHashMap;
62.15 +import java.util.concurrent.CountDownLatch;
62.16 import java.util.concurrent.Future;
62.17 import java.util.logging.Level;
62.18 import java.util.logging.Logger;
62.19 @@ -99,6 +101,7 @@
62.20 import org.netbeans.modules.cnd.makeproject.api.ProjectSupport;
62.21 import org.netbeans.modules.cnd.makeproject.api.SourceFolderInfo;
62.22 import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
62.23 +import org.netbeans.modules.cnd.makeproject.api.configurations.Folder;
62.24 import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
62.25 import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor;
62.26 import org.netbeans.modules.cnd.makeproject.api.wizards.IteratorExtension;
62.27 @@ -185,6 +188,7 @@
62.28 private static final String CND_TOOLS_VALUE = System.getProperty("cnd.buildtrace.tools", "gcc:c++:g++:gfortran:g77:g90:g95:cc:CC:ffortran:f77:f90:f95"); //NOI18N
62.29 private static final String CND_BUILD_LOG = "__CND_BUILD_LOG__"; //NOI18N
62.30 private boolean useBuildTrace = true;
62.31 + private final CountDownLatch waitSources = new CountDownLatch(1);
62.32
62.33
62.34 public ImportRemoteProject(WizardDescriptor wizard) {
62.35 @@ -287,7 +291,7 @@
62.36 public Set<FileObject> create() throws IOException {
62.37 Set<FileObject> resultSet = new HashSet<FileObject>();
62.38 String aHostUID = ExecutionEnvironmentFactory.toUniqueID(ExecutionEnvironmentFactory.getLocal());
62.39 - MakeConfiguration extConf = new MakeConfiguration(projectFolder.getPath(), "Default", MakeConfiguration.TYPE_MAKEFILE, aHostUID, toolchain, defaultToolchain); // NOI18N
62.40 + MakeConfiguration extConf = MakeConfiguration.createMakefileConfiguration(projectFolder, "Default", aHostUID, toolchain, defaultToolchain); // NOI18N
62.41 int platform = CompilerSetManager.get(executionEnvironment).getPlatform();
62.42 extConf.getDevelopmentHost().setBuildPlatform(platform);
62.43 String workingDirRel = ProjectSupport.toProperPath(projectFolder.getPath(), CndPathUtilitities.naturalizeSlashes(workingDir), pathMode);
62.44 @@ -349,7 +353,8 @@
62.45 ProjectGenerator.ProjectParameters prjParams = new ProjectGenerator.ProjectParameters(projectName, projectFolder);
62.46 prjParams
62.47 .setConfiguration(extConf)
62.48 - .setSourceFolders(sources)
62.49 + .setSourceFolders(Collections.<SourceFolderInfo>emptyList().iterator())
62.50 + //.setSourceFolders(sources)
62.51 .setSourceFoldersFilter(sourceFoldersFilter)
62.52 .setTestFolders(tests)
62.53 .setImportantFiles(importantItemsIterator)
62.54 @@ -413,6 +418,24 @@
62.55 ConfigurationDescriptorProvider pdp = makeProject.getLookup().lookup(ConfigurationDescriptorProvider.class);
62.56 pdp.getConfigurationDescriptor();
62.57 if (pdp.gotDescriptor()) {
62.58 + final MakeConfigurationDescriptor configurationDescriptor = pdp.getConfigurationDescriptor();
62.59 + if (sources != null) {
62.60 + RP.post(new Runnable() {
62.61 + @Override
62.62 + public void run() {
62.63 + ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(ImportRemoteProject.class, "ImportProject.Progress.AnalyzeRoot"));
62.64 + handle.start();
62.65 + while(sources.hasNext()) {
62.66 + SourceFolderInfo next = sources.next();
62.67 + configurationDescriptor.addFilesFromRoot(configurationDescriptor.getLogicalFolders(), next.getFileObject(), handle, false, Folder.Kind.SOURCE_DISK_FOLDER, null);
62.68 + }
62.69 + handle.finish();
62.70 + waitSources.countDown();
62.71 + }
62.72 + });
62.73 + } else {
62.74 + waitSources.countDown();
62.75 + }
62.76 if (pdp.getConfigurationDescriptor().getActiveConfiguration() != null) {
62.77 if (runConfigure && configurePath != null && configurePath.length() > 0 &&
62.78 configureFileObject != null && configureFileObject.isValid()) {
62.79 @@ -872,6 +895,10 @@
62.80 // Make sure that descriptor was stored and readed
62.81 ConfigurationDescriptorProvider provider = makeProject.getLookup().lookup(ConfigurationDescriptorProvider.class);
62.82 provider.getConfigurationDescriptor(true);
62.83 + try {
62.84 + waitSources.await();
62.85 + } catch (InterruptedException ex) {
62.86 + }
62.87 }
62.88
62.89 private void discovery(int rc, String makeLog, File execLog) {
63.1 --- a/cnd.remote.projectui/src/org/netbeans/modules/cnd/remote/projectui/wizard/cnd/NewMakeProjectWizardIterator.java Tue Feb 19 16:39:13 2013 +0100
63.2 +++ b/cnd.remote.projectui/src/org/netbeans/modules/cnd/remote/projectui/wizard/cnd/NewMakeProjectWizardIterator.java Wed Feb 20 15:23:50 2013 +0100
63.3 @@ -396,6 +396,7 @@
63.4 }
63.5 } else if (wizardtype == TYPE_APPLICATION || wizardtype == TYPE_DYNAMIC_LIB || wizardtype == TYPE_STATIC_LIB || wizardtype == TYPE_QT_APPLICATION || wizardtype == TYPE_QT_DYNAMIC_LIB || wizardtype == TYPE_QT_STATIC_LIB || wizardtype == TYPE_DB_APPLICATION) {
63.6 int conftype = -1;
63.7 + String customizerId = null;
63.8 if (wizardtype == TYPE_APPLICATION) {
63.9 conftype = MakeConfiguration.TYPE_APPLICATION;
63.10 } else if (wizardtype == TYPE_DYNAMIC_LIB) {
63.11 @@ -417,7 +418,7 @@
63.12 String template = (String) wiz.getProperty("mainFileTemplate"); // NOI18N
63.13 mainFile = fname + "|" + template; // NOI18N
63.14 }
63.15 - MakeConfiguration debug = new MakeConfiguration(dirF, "Debug", conftype, hostUID, toolchain, defaultToolchain); // NOI18N
63.16 + MakeConfiguration debug = MakeConfiguration.createConfiguration(dirF, "Debug", conftype, customizerId, hostUID, toolchain, defaultToolchain); // NOI18N
63.17 debug.getCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_DEBUG);
63.18 debug.getCCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_DEBUG);
63.19 debug.getFortranCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_DEBUG);
63.20 @@ -432,7 +433,7 @@
63.21 }
63.22 int platform = CompilerSetManager.get(((ExecutionEnvironment) wiz.getProperty(WizardConstants.PROPERTY_REMOTE_FILE_SYSTEM_ENV))).getPlatform();
63.23 debug.getDevelopmentHost().setBuildPlatform(platform);
63.24 - MakeConfiguration release = new MakeConfiguration(dirF, "Release", conftype, hostUID, toolchain, defaultToolchain); // NOI18N
63.25 + MakeConfiguration release = MakeConfiguration.createConfiguration(dirF, "Release", conftype, customizerId, hostUID, toolchain, defaultToolchain); // NOI18N
63.26 release.getCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_RELEASE);
63.27 release.getCCCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_RELEASE);
63.28 release.getFortranCompilerConfiguration().getDevelopmentMode().setValue(BasicCompilerConfiguration.DEVELOPMENT_MODE_RELEASE);
64.1 --- a/cnd.utils/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
64.2 +++ b/cnd.utils/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
64.3 @@ -110,6 +110,7 @@
64.4 <friend>com.microchip.mplab.debugger.mdb</friend>
64.5 <friend>com.microchip.mplab.nbide.embedded</friend>
64.6 <friend>com.microchip.mplab.nbide.embedded.makeproject</friend>
64.7 + <friend>com.oracle.tools.ide.launchers</friend>
64.8 <friend>com.oracle.tools.ide.projectless.debug.impl</friend>
64.9 <friend>com.oracle.tools.ide.projectless.impl</friend>
64.10 <friend>com.oracle.tools.usagecounting</friend>
65.1 --- a/cordova.platforms.android/manifest.mf Tue Feb 19 16:39:13 2013 +0100
65.2 +++ b/cordova.platforms.android/manifest.mf Wed Feb 20 15:23:50 2013 +0100
65.3 @@ -2,5 +2,5 @@
65.4 AutoUpdate-Show-In-Client: false
65.5 OpenIDE-Module: org.netbeans.modules.cordova.platforms.android
65.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/platforms/android/Bundle.properties
65.7 -OpenIDE-Module-Specification-Version: 1.6
65.8 +OpenIDE-Module-Specification-Version: 1.7
65.9
66.1 --- a/cordova.platforms.android/src/org/netbeans/modules/cordova/platforms/android/AndroidDevice.java Tue Feb 19 16:39:13 2013 +0100
66.2 +++ b/cordova.platforms.android/src/org/netbeans/modules/cordova/platforms/android/AndroidDevice.java Wed Feb 20 15:23:50 2013 +0100
66.3 @@ -92,7 +92,33 @@
66.4 @Override
66.5 public void openUrl(String url) {
66.6 try {
66.7 - String s = ProcessUtils.callProcess(((AndroidPlatform) getPlatform()).getAdbCommand(), true, isEmulator() ? "-e" : "-d", "wait-for-device", "shell", "am", "start", "-a", "android.intent.action.VIEW", "-n", getPrefferedBrowser(), url); //NOI18N
66.8 + if (browser == browser.DEFAULT) {
66.9 + ProcessUtils.callProcess(
66.10 + ((AndroidPlatform) getPlatform()).getAdbCommand(),
66.11 + true,
66.12 + isEmulator() ? "-e" : "-d",
66.13 + "wait-for-device",
66.14 + "shell",
66.15 + "am",
66.16 + "start",
66.17 + "-a",
66.18 + "android.intent.action.VIEW",
66.19 + url); //NOI18N
66.20 + } else {
66.21 + ProcessUtils.callProcess(
66.22 + ((AndroidPlatform) getPlatform()).getAdbCommand(),
66.23 + true,
66.24 + isEmulator() ? "-e" : "-d",
66.25 + "wait-for-device",
66.26 + "shell",
66.27 + "am",
66.28 + "start",
66.29 + "-a",
66.30 + "android.intent.action.VIEW",
66.31 + "-n",
66.32 + getPrefferedBrowser(),
66.33 + url); //NOI18N
66.34 + }
66.35 } catch (IOException ex) {
66.36 Exceptions.printStackTrace(ex);
66.37 }
67.1 --- a/cordova.platforms.ios/manifest.mf Tue Feb 19 16:39:13 2013 +0100
67.2 +++ b/cordova.platforms.ios/manifest.mf Wed Feb 20 15:23:50 2013 +0100
67.3 @@ -2,5 +2,5 @@
67.4 AutoUpdate-Show-In-Client: false
67.5 OpenIDE-Module: org.netbeans.modules.cordova.platforms.ios
67.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/platforms/ios/Bundle.properties
67.7 -OpenIDE-Module-Specification-Version: 1.5
67.8 +OpenIDE-Module-Specification-Version: 1.6
67.9
68.1 --- a/cordova.platforms/manifest.mf Tue Feb 19 16:39:13 2013 +0100
68.2 +++ b/cordova.platforms/manifest.mf Wed Feb 20 15:23:50 2013 +0100
68.3 @@ -2,5 +2,5 @@
68.4 AutoUpdate-Show-In-Client: false
68.5 OpenIDE-Module: org.netbeans.modules.cordova.platforms
68.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/platforms/Bundle.properties
68.7 -OpenIDE-Module-Specification-Version: 1.4
68.8 +OpenIDE-Module-Specification-Version: 1.5
68.9
69.1 --- a/cordova/manifest.mf Tue Feb 19 16:39:13 2013 +0100
69.2 +++ b/cordova/manifest.mf Wed Feb 20 15:23:50 2013 +0100
69.3 @@ -1,5 +1,5 @@
69.4 Manifest-Version: 1.0
69.5 OpenIDE-Module: org.netbeans.modules.cordova
69.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cordova/Bundle.properties
69.7 -OpenIDE-Module-Specification-Version: 1.8
69.8 +OpenIDE-Module-Specification-Version: 1.9
69.9 OpenIDE-Module-Layer: org/netbeans/modules/cordova/resources/layer.xml
70.1 --- a/cordova/src/org/netbeans/modules/cordova/CordovaLibrariesProvider.java Tue Feb 19 16:39:13 2013 +0100
70.2 +++ b/cordova/src/org/netbeans/modules/cordova/CordovaLibrariesProvider.java Wed Feb 20 15:23:50 2013 +0100
70.3 @@ -81,7 +81,7 @@
70.4 lib.setName("Cordova"); // NOI18N
70.5 lib.setDisplayName("Cordova"); // NOI18N
70.6 Map<String, String> p = new HashMap<String, String>();
70.7 - final String version = CordovaPlatform.getDefault().getVersion();
70.8 + final String version = CordovaPlatform.getDefault().getVersion().toString();
70.9 p.put("version", version);//NOI18N
70.10 p.put("name", "Cordova"); //NOI18N
70.11 p.put("displayname", "Cordova"); //NOI18N
71.1 --- a/cordova/src/org/netbeans/modules/cordova/CordovaPerformer.java Tue Feb 19 16:39:13 2013 +0100
71.2 +++ b/cordova/src/org/netbeans/modules/cordova/CordovaPerformer.java Wed Feb 20 15:23:50 2013 +0100
71.3 @@ -55,6 +55,7 @@
71.4 import org.netbeans.modules.cordova.platforms.BuildPerformer;
71.5 import org.netbeans.modules.cordova.platforms.Device;
71.6 import org.netbeans.modules.cordova.platforms.MobileDebugTransport;
71.7 +import org.netbeans.modules.cordova.platforms.PlatformManager;
71.8 import org.netbeans.modules.cordova.project.ClientProjectConfigurationImpl;
71.9 import org.netbeans.modules.cordova.project.ClientProjectUtilities;
71.10 import org.netbeans.modules.web.browser.api.PageInspector;
71.11 @@ -64,6 +65,7 @@
71.12 import org.netbeans.modules.web.webkit.debugging.api.WebKitDebugging;
71.13 import org.netbeans.modules.web.webkit.debugging.spi.Factory;
71.14 import org.netbeans.modules.web.webkit.debugging.spi.netbeansdebugger.NetBeansJavaScriptDebuggerFactory;
71.15 +import org.netbeans.spi.project.ProjectConfiguration;
71.16 import org.netbeans.spi.project.ProjectConfigurationProvider;
71.17 import org.openide.filesystems.FileObject;
71.18 import org.openide.filesystems.FileUtil;
71.19 @@ -118,11 +120,11 @@
71.20
71.21 private Properties properties(Project p) {
71.22 ProjectConfigurationProvider provider = p.getLookup().lookup(ProjectConfigurationProvider.class);
71.23 - ClientProjectConfigurationImpl activeConfiguration = (ClientProjectConfigurationImpl) provider.getActiveConfiguration();
71.24 + ProjectConfiguration activeConfiguration = provider.getActiveConfiguration();
71.25 Properties props = new Properties();
71.26 final CordovaPlatform phoneGap = CordovaPlatform.getDefault();
71.27 props.put("cordova.home", phoneGap.getSdkLocation());//NOI18N
71.28 - props.put("cordova.version", phoneGap.getVersion());//NOI18N
71.29 + props.put("cordova.version", phoneGap.getVersion().toString());//NOI18N
71.30 props.put("site.root", org.netbeans.modules.cordova.project.ClientProjectUtilities.getSiteRoot(p).getPath());
71.31 props.put("start.file", org.netbeans.modules.cordova.project.ClientProjectUtilities.getStartFile(p).getPath());
71.32
71.33 @@ -133,8 +135,12 @@
71.34 props.put("debug.enable", debug);//NOI18N
71.35 //workaround for some strange behavior of ant execution in netbeans
71.36 props.put("env.DISPLAY", ":0.0");//NOI18N
71.37 - props.put("config", activeConfiguration.getId());
71.38 - activeConfiguration.getDevice().addProperties(props);
71.39 + if (activeConfiguration instanceof ClientProjectConfigurationImpl) {
71.40 + props.put("config", ((ClientProjectConfigurationImpl) activeConfiguration).getId());
71.41 + ((ClientProjectConfigurationImpl) activeConfiguration).getDevice().addProperties(props);
71.42 + }
71.43 +
71.44 + props.put("android.sdk.home", PlatformManager.getPlatform(PlatformManager.ANDROID_TYPE).getSdkLocation());
71.45 return props;
71.46 }
71.47
71.48 @@ -142,6 +148,7 @@
71.49 try {
71.50 createScript(project, "build.xml", "nbproject/build.xml");//NOI18N
71.51 createProperties(project, "build.properties", "nbproject/build.properties");//NOI18N
71.52 + createScript(project, "config.xml", "public_html/config.xml");//NOI18N
71.53 } catch (IOException ex) {
71.54 Exceptions.printStackTrace(ex);
71.55 }
72.1 --- a/cordova/src/org/netbeans/modules/cordova/CordovaPlatform.java Tue Feb 19 16:39:13 2013 +0100
72.2 +++ b/cordova/src/org/netbeans/modules/cordova/CordovaPlatform.java Wed Feb 20 15:23:50 2013 +0100
72.3 @@ -54,8 +54,8 @@
72.4 private static CordovaPlatform instance;
72.5
72.6 private static String CORDOVA_SDK_ROOT_PREF = "cordova.home";//NOI18N
72.7 -
72.8 - private String version;
72.9 +
72.10 + private Version version;
72.11
72.12 private transient final java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this);
72.13
72.14 @@ -81,19 +81,52 @@
72.15 NbPreferences.forModule(CordovaPlatform.class).put(CORDOVA_SDK_ROOT_PREF, sdkLocation);
72.16 propertyChangeSupport.firePropertyChange("SDK", null, sdkLocation);//NOI18N
72.17 }
72.18 +
72.19 + public static Version getVersion(String sdkLocation) {
72.20 + if (!checkPhonegapLocation(sdkLocation)) {
72.21 + throw new IllegalArgumentException();
72.22 + }
72.23
72.24 - public String getVersion() {
72.25 + final BufferedReader bufferedReader;
72.26 + try {
72.27 + bufferedReader = new BufferedReader(new FileReader(sdkLocation + "/VERSION")); //NOI18N;
72.28 + try {
72.29 + String v = bufferedReader.readLine().trim();
72.30 + return new Version(v);
72.31 + } catch (IOException ex) {
72.32 + Exceptions.printStackTrace(ex);
72.33 +
72.34 + } finally {
72.35 + try {
72.36 + bufferedReader.close();
72.37 + } catch (IOException ex) {
72.38 + Exceptions.printStackTrace(ex);
72.39 + }
72.40 +
72.41 + }
72.42 + } catch (FileNotFoundException ex) {
72.43 + throw new IllegalArgumentException();
72.44 + }
72.45 + throw new IllegalArgumentException();
72.46 + }
72.47 +
72.48 + private static boolean checkPhonegapLocation(String sdkLocation) {
72.49 + File cordovaLoc = new File(sdkLocation);
72.50 + File cordovaAndroid = new File(cordovaLoc, "lib/android"); //NOI18N
72.51 + File cordovaIOS = new File(cordovaLoc, "lib/ios"); //NOI18N
72.52 + File version = new File(cordovaLoc, "VERSION");
72.53 + return (cordovaLoc.exists() && cordovaLoc.isDirectory()
72.54 + && cordovaAndroid.exists() && cordovaAndroid.isDirectory()
72.55 + && cordovaIOS.exists() && cordovaIOS.isDirectory())
72.56 + && version.exists();
72.57 + }
72.58 +
72.59 +
72.60 + public Version getVersion() {
72.61 final String sdkLocation = getSdkLocation();
72.62 assert sdkLocation != null;
72.63 if (version == null) {
72.64 - final BufferedReader bufferedReader;
72.65 - try {
72.66 - bufferedReader = new BufferedReader(new FileReader(sdkLocation + "/VERSION"));//NOI18N
72.67 - version = bufferedReader.readLine().trim();
72.68 - bufferedReader.close();
72.69 - } catch (IOException ex) {
72.70 - Exceptions.printStackTrace(ex);
72.71 - }
72.72 + version = getVersion(sdkLocation);
72.73 }
72.74 return version;
72.75 }
72.76 @@ -120,5 +153,29 @@
72.77 public boolean isReady() {
72.78 return getSdkLocation() != null;
72.79 }
72.80 +
72.81 + public static class Version implements Comparable<Version> {
72.82 +
72.83 + String version;
72.84 +
72.85 + public Version(String version) {
72.86 + this.version = version;
72.87 + }
72.88 +
72.89 +
72.90 + @Override
72.91 + public int compareTo(Version o) {
72.92 + return version.compareTo(o.version);
72.93 + }
72.94 +
72.95 + @Override
72.96 + public String toString() {
72.97 + return version;
72.98 + }
72.99 +
72.100 + public boolean isSupported() {
72.101 + return compareTo(new Version(("2.4")))>0;
72.102 + }
72.103 + }
72.104 }
72.105
73.1 --- a/cordova/src/org/netbeans/modules/cordova/build.properties Tue Feb 19 16:39:13 2013 +0100
73.2 +++ b/cordova/src/org/netbeans/modules/cordova/build.properties Wed Feb 20 15:23:50 2013 +0100
73.3 @@ -1,10 +1,12 @@
73.4 #Android specific properties
73.5 android.build.projects.dir=build/android
73.6 -android.generated.dir=generated/android
73.7 +android.generated.dir=platforms/android
73.8 android.project.package=com.company
73.9
73.10 #iOS specific properties
73.11 ios.build.projects.dir=build/ios
73.12 ios.build.configuration=Release
73.13 -ios.generated.dir=generated/ios
73.14 +ios.generated.dir=platforms/ios
73.15
73.16 +cordova.platforms=platforms
73.17 +
74.1 --- a/cordova/src/org/netbeans/modules/cordova/build.xml Tue Feb 19 16:39:13 2013 +0100
74.2 +++ b/cordova/src/org/netbeans/modules/cordova/build.xml Wed Feb 20 15:23:50 2013 +0100
74.3 @@ -50,11 +50,20 @@
74.4 <property name="ios.exec.simulator" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator"/>
74.5 <property name="cordova.ios.template" value="${cordova.home}/lib/ios/bin/templates/project" />
74.6
74.7 + <scriptdef name="checkVersion" language="javascript">
74.8 + <attribute name="first" />
74.9 + <attribute name="property" />
74.10 + <![CDATA[
74.11 + var first = attributes.get("first");
74.12 + if (first >= "2.4.0") {
74.13 + project.setProperty(attributes.get("property"), true);
74.14 + }
74.15 + ]]>
74.16 + </scriptdef>
74.17 +
74.18 <target name="check-phonegap-version">
74.19 - <condition property="phonegap.ver.2">
74.20 - <matches pattern="^[2-9]." string="${cordova.version}"/>
74.21 - </condition>
74.22 - <fail message="PhoneGap version 2.0 or greater required." unless="phonegap.ver.2"/>
74.23 + <checkVersion first="${cordova.version}" property="phonegap.ver.2"/>
74.24 + <fail message="PhoneGap version 2.4 or greater required." unless="phonegap.ver.2"/>
74.25 </target>
74.26
74.27 <target name="check-android-template">
74.28 @@ -66,38 +75,41 @@
74.29 </target>
74.30
74.31 <target name="create-android" depends="check-android-template,check-phonegap-version" unless="android.generated.exists">
74.32 - <mkdir dir="${android.generated.dir}"/>
74.33 + <mkdir dir="${cordova.platforms}"/>
74.34
74.35 - <exec dir="${android.generated.dir}" executable="/bin/sh" osfamily="unix" resolveexecutable="true" failonerror="true">
74.36 + <exec dir="${cordova.platforms}" executable="/bin/sh" osfamily="unix" resolveexecutable="true" failonerror="true">
74.37 <env key="PATH" path="/usr/bin:/bin:${android.sdk.home}/tools"/>
74.38 <arg value="${cordova.home}/lib/android/bin/create"/>
74.39 - <arg value="${project.name}" />
74.40 + <arg value="android"/>
74.41 <arg value="${android.project.package}"/>
74.42 <arg value="${android.project.activity}"/>
74.43 </exec>
74.44
74.45 - <exec dir="${android.generated.dir}" executable="cmd" osfamily="windows" resolveexecutable="true" failonerror="true" >
74.46 + <exec dir="${cordova.platforms}" executable="cmd" osfamily="windows" resolveexecutable="true" failonerror="true" >
74.47 <env key="PATH" path="%PATH%;c:\Windows\System32;${android.sdk.home}\tools;${ant.home}\bin;${jdk.home}\bin"/>
74.48 <env key="JAVA_HOME" path="${jdk.home}"/>
74.49 <arg value="/C"/>
74.50 <arg value="${cordova.home}/lib/android/bin/create.bat"/>
74.51 - <arg value="${project.name}" />
74.52 + <arg value="android" />
74.53 <arg value="${android.project.package}"/>
74.54 <arg value="${android.project.activity}"/>
74.55 </exec>
74.56
74.57 <!-- allow all hosts -->
74.58 - <replace file="${android.generated.dir}/${project.name}/res/xml/config.xml">
74.59 + <replace file="${android.generated.dir}/res/xml/config.xml">
74.60 <replacefilter>
74.61 <replacetoken>http://127.0.0.1</replacetoken>
74.62 <replacevalue>.</replacevalue>
74.63 </replacefilter>
74.64 </replace>
74.65
74.66 + <!-- copy resources -->
74.67 + <copydir src="${android.generated.dir}/assets/www/res" dest="public_html/res"/>
74.68 +
74.69 <!-- delete www -->
74.70 - <delete dir="${android.generated.dir}/${project.name}/assets/www" />
74.71 + <delete dir="${android.generated.dir}/assets/www" />
74.72
74.73 - <mkdir dir="${android.generated.dir}/${project.name}/assets/www" />
74.74 + <mkdir dir="${android.generated.dir}/assets/www" />
74.75
74.76
74.77 </target>
74.78 @@ -112,12 +124,16 @@
74.79 </exec>
74.80
74.81 <!-- allow all hosts -->
74.82 - <replace file="${ios.generated.dir}/${project.name}/Cordova.plist">
74.83 + <!-- <replace file="${ios.generated.dir}/${project.name}/Cordova.plist">
74.84 <replacefilter>
74.85 <replacetoken><![CDATA[<array/>]]></replacetoken>
74.86 <replacevalue><![CDATA[<array><string>*</string></array>]]></replacevalue>
74.87 </replacefilter>
74.88 - </replace>
74.89 + </replace> -->
74.90 +
74.91 + <!-- copy resources -->
74.92 + <copydir src="${ios.generated.dir}/www/res" dest="public_html/res"/>
74.93 +
74.94 <!-- delete www -->
74.95 <delete dir="${ios.generated.dir}/www" />
74.96
74.97 @@ -137,8 +153,8 @@
74.98 <fileset dir="${site.root}" excludes="generated/,build/,nbproject/,js/libs/Cordova-${cordova.version}/cordova-${cordova.version}.js" />
74.99 </copy>
74.100
74.101 - <copy todir="${ios.build.projects.dir}/www/js/libs/Cordova-${cordova.version}"
74.102 - file="${cordova.ios.template}/www/cordova-${cordova.version}.js" />
74.103 + <copy tofile="${ios.build.projects.dir}/www/js/libs/Cordova-${cordova.version}/cordova-${cordova.version}.js"
74.104 + file="${cordova.home}/lib/ios/CordovaLib/cordova.ios.js"/>
74.105
74.106 </target>
74.107 <target name="build-ios" depends="setup-ios">
74.108 @@ -185,19 +201,19 @@
74.109 </copy>
74.110
74.111 <!-- copy all html -->
74.112 - <copy todir="${android.build.projects.dir}/${project.name}/assets/www">
74.113 - <fileset dir="${site.root}" excludes="generated/,build/,nbproject/,js/libs/Cordova-${cordova.version}/cordova-${cordova.version}.js" />
74.114 + <copy todir="${android.build.projects.dir}/assets/www">
74.115 + <fileset dir="${site.root}" excludes="${cordova.platforms}/,build/,nbproject/,js/libs/Cordova-${cordova.version}/cordova-${cordova.version}.js" />
74.116 </copy>
74.117 - <copy todir="${android.build.projects.dir}/${project.name}/assets/www/js/libs/Cordova-${cordova.version}"
74.118 + <copy todir="${android.build.projects.dir}/assets/www/js/libs/Cordova-${cordova.version}"
74.119 file="${cordova.home}/lib/android/cordova-${cordova.version}.js" />
74.120
74.121 </target>
74.122
74.123 <target name="build-android" depends="setup-android">
74.124 - <ant dir="${android.build.projects.dir}/${project.name}" target="debug"/>
74.125 + <ant dir="${android.build.projects.dir}" target="debug"/>
74.126 </target>
74.127 <target name="sim-android" depends="build-android">
74.128 - <ant dir="${android.build.projects.dir}/${project.name}" target="installd">
74.129 + <ant dir="${android.build.projects.dir}" target="installd">
74.130 <property name="adb.device.arg" value="${android.target.device.arg}"/>
74.131 </ant>
74.132 <exec executable="${android.sdk.home}/platform-tools/adb">
75.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
75.2 +++ b/cordova/src/org/netbeans/modules/cordova/config.xml Wed Feb 20 15:23:50 2013 +0100
75.3 @@ -0,0 +1,44 @@
75.4 +<?xml version="1.0" encoding="UTF-8"?>
75.5 +<widget xmlns = "http://www.w3.org/ns/widgets"
75.6 + xmlns:gap = "http://phonegap.com/ns/1.0"
75.7 + id = "$id"
75.8 + version = "2.0.0">
75.9 + <name>$name</name>
75.10 +
75.11 + <description>
75.12 + $description
75.13 + </description>
75.14 +
75.15 + <author href="$author_href" email="$author_email">
75.16 + $author
75.17 + </author>
75.18 +
75.19 + <icon src="res/icon/android/icon-96-xhdpi.png" width="96" height="96" gap:platform="android" />
75.20 + <icon src="res/icon/ios/icon-72-2x.png" width="144" height="144" gap:platform="ios" />
75.21 +
75.22 + <gap:splash src="res/screen/android/screen_hdpi_landscape.png" width="800" height="480" gap:platform="android" />
75.23 + <gap:splash src="res/screen/android/screen_hdpi_portrait.png" width="480" height="800" gap:platform="android" />
75.24 + <gap:splash src="res/screen/android/screen_ldpi_landscape.png" width="320" height="200" gap:platform="android" />
75.25 + <gap:splash src="res/screen/android/screen_ldpi_portrait.png" width="200" height="320" gap:platform="android" />
75.26 + <gap:splash src="res/screen/android/screen_mdpi_landscape.png" width="480" height="320" gap:platform="android" />
75.27 + <gap:splash src="res/screen/android/screen_mdpi_portrait.png" width="320" height="480" gap:platform="android" />
75.28 + <gap:splash src="res/screen/android/screen_xhdpi_landscape.png" width="1280" height="720" gap:platform="android" />
75.29 + <gap:splash src="res/screen/android/screen_xhdpi_portrait.png" width="720" height="1280" gap:platform="android" />
75.30 + <gap:splash src="res/screen/ios/screen-ipad-landscape.png" width="1024" height="748" gap:platform="ios" />
75.31 + <gap:splash src="res/screen/ios/screen-ipad-portrait.png" width="768" height="1004" gap:platform="ios" />
75.32 + <gap:splash src="res/screen/ios/screen-ipad-landscape.png" width="2048" height="1496" gap:platform="ios" />
75.33 + <gap:splash src="res/screen/ios/screen-ipad-portrait-2x.png" width="1536" height="2008" gap:platform="ios" />
75.34 + <gap:splash src="res/screen/ios/screen-iphone-landscape.png" width="480" height="320" gap:platform="ios" />
75.35 + <gap:splash src="res/screen/ios/screen-iphone-portrait.png" width="320" height="480" gap:platform="ios" />
75.36 + <gap:splash src="res/screen/ios/screen-iphone-landscape-2x.png" width="960" height="640" gap:platform="ios" />
75.37 + <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" height="960" gap:platform="ios" />
75.38 +
75.39 + <feature name="http://api.phonegap.com/1.0/device" />
75.40 +
75.41 + <preference name="phonegap-version" value="2.4.0" />
75.42 + <preference name="orientation" value="default" />
75.43 + <preference name="target-device" value="universal" />
75.44 + <preference name="fullscreen" value="false" />
75.45 +
75.46 + <access origin="*" />
75.47 +</widget>
76.1 --- a/cordova/src/org/netbeans/modules/cordova/options/MobilePlatformsPanel.form Tue Feb 19 16:39:13 2013 +0100
76.2 +++ b/cordova/src/org/netbeans/modules/cordova/options/MobilePlatformsPanel.form Wed Feb 20 15:23:50 2013 +0100
76.3 @@ -45,16 +45,18 @@
76.4 <Group type="103" groupAlignment="0" attributes="0">
76.5 <Group type="102" attributes="0">
76.6 <EmptySpace max="-2" attributes="0"/>
76.7 + <Component id="androidSdkLabel" min="-2" max="-2" attributes="0"/>
76.8 + <EmptySpace max="-2" attributes="0"/>
76.9 <Group type="103" groupAlignment="0" attributes="0">
76.10 <Group type="102" attributes="0">
76.11 - <Component id="androidSdkLabel" min="-2" max="-2" attributes="0"/>
76.12 - <EmptySpace max="-2" attributes="0"/>
76.13 <Component id="androidSdkField" max="32767" attributes="0"/>
76.14 <EmptySpace max="-2" attributes="0"/>
76.15 <Component id="androidSdkBrowse" min="-2" max="-2" attributes="0"/>
76.16 </Group>
76.17 - <Group type="102" alignment="1" attributes="0">
76.18 - <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
76.19 + <Group type="102" attributes="0">
76.20 + <EmptySpace min="6" pref="6" max="-2" attributes="0"/>
76.21 + <Component id="androidVersion" min="-2" max="-2" attributes="0"/>
76.22 + <EmptySpace max="32767" attributes="0"/>
76.23 <Component id="androidSdkDownload" min="-2" max="-2" attributes="0"/>
76.24 </Group>
76.25 </Group>
76.26 @@ -72,7 +74,10 @@
76.27 <Component id="androidSdkBrowse" alignment="3" min="-2" max="-2" attributes="0"/>
76.28 </Group>
76.29 <EmptySpace max="-2" attributes="0"/>
76.30 - <Component id="androidSdkDownload" min="-2" max="-2" attributes="0"/>
76.31 + <Group type="103" groupAlignment="3" attributes="0">
76.32 + <Component id="androidSdkDownload" alignment="3" min="-2" max="-2" attributes="0"/>
76.33 + <Component id="androidVersion" alignment="3" min="-2" max="-2" attributes="0"/>
76.34 + </Group>
76.35 <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
76.36 </Group>
76.37 </Group>
76.38 @@ -108,6 +113,8 @@
76.39 <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="androidSdkDownloadMouseClicked"/>
76.40 </Events>
76.41 </Component>
76.42 + <Component class="javax.swing.JLabel" name="androidVersion">
76.43 + </Component>
76.44 </SubComponents>
76.45 </Container>
76.46 <Container class="javax.swing.JPanel" name="cordovaPanel">
76.47 @@ -117,16 +124,18 @@
76.48 <Group type="103" groupAlignment="0" attributes="0">
76.49 <Group type="102" attributes="0">
76.50 <EmptySpace max="-2" attributes="0"/>
76.51 + <Component id="cordovaSdkLabel" min="-2" max="-2" attributes="0"/>
76.52 + <EmptySpace max="-2" attributes="0"/>
76.53 <Group type="103" groupAlignment="0" attributes="0">
76.54 - <Group type="102" alignment="0" attributes="0">
76.55 - <Component id="cordovaSdkLabel" min="-2" max="-2" attributes="0"/>
76.56 - <EmptySpace max="-2" attributes="0"/>
76.57 + <Group type="102" attributes="0">
76.58 <Component id="cordovaSdkField" pref="435" max="32767" attributes="0"/>
76.59 <EmptySpace max="-2" attributes="0"/>
76.60 <Component id="cordovaSdkBrowse" min="-2" max="-2" attributes="0"/>
76.61 </Group>
76.62 - <Group type="102" alignment="1" attributes="0">
76.63 - <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
76.64 + <Group type="102" attributes="0">
76.65 + <EmptySpace min="6" pref="6" max="-2" attributes="0"/>
76.66 + <Component id="phonegapVersion" min="-2" max="-2" attributes="0"/>
76.67 + <EmptySpace max="32767" attributes="0"/>
76.68 <Component id="cordovaSdkDownload" min="-2" max="-2" attributes="0"/>
76.69 </Group>
76.70 </Group>
76.71 @@ -144,7 +153,10 @@
76.72 <Component id="cordovaSdkBrowse" alignment="3" min="-2" max="-2" attributes="0"/>
76.73 </Group>
76.74 <EmptySpace max="-2" attributes="0"/>
76.75 - <Component id="cordovaSdkDownload" min="-2" max="-2" attributes="0"/>
76.76 + <Group type="103" groupAlignment="3" attributes="0">
76.77 + <Component id="cordovaSdkDownload" alignment="3" min="-2" max="-2" attributes="0"/>
76.78 + <Component id="phonegapVersion" alignment="3" min="-2" max="-2" attributes="0"/>
76.79 + </Group>
76.80 <EmptySpace pref="28" max="32767" attributes="0"/>
76.81 </Group>
76.82 </Group>
76.83 @@ -180,6 +192,8 @@
76.84 <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="cordovaSdkDownloadMouseClicked"/>
76.85 </Events>
76.86 </Component>
76.87 + <Component class="javax.swing.JLabel" name="phonegapVersion">
76.88 + </Component>
76.89 </SubComponents>
76.90 </Container>
76.91 </SubComponents>
77.1 --- a/cordova/src/org/netbeans/modules/cordova/options/MobilePlatformsPanel.java Tue Feb 19 16:39:13 2013 +0100
77.2 +++ b/cordova/src/org/netbeans/modules/cordova/options/MobilePlatformsPanel.java Wed Feb 20 15:23:50 2013 +0100
77.3 @@ -88,18 +88,19 @@
77.4 */
77.5 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
77.6 private void initComponents() {
77.7 - java.awt.GridBagConstraints gridBagConstraints;
77.8
77.9 androidPanel = new javax.swing.JPanel();
77.10 androidSdkLabel = new javax.swing.JLabel();
77.11 androidSdkField = new javax.swing.JTextField();
77.12 androidSdkBrowse = new javax.swing.JButton();
77.13 androidSdkDownload = new javax.swing.JLabel();
77.14 + androidVersion = new javax.swing.JLabel();
77.15 cordovaPanel = new javax.swing.JPanel();
77.16 cordovaSdkLabel = new javax.swing.JLabel();
77.17 cordovaSdkField = new javax.swing.JTextField();
77.18 cordovaSdkBrowse = new javax.swing.JButton();
77.19 cordovaSdkDownload = new javax.swing.JLabel();
77.20 + phonegapVersion = new javax.swing.JLabel();
77.21
77.22 org.openide.awt.Mnemonics.setLocalizedText(androidSdkLabel, org.openide.util.NbBundle.getMessage(MobilePlatformsPanel.class, "MobilePlatformsPanel.androidSdkLabel.text")); // NOI18N
77.23
77.24 @@ -123,15 +124,17 @@
77.25 androidPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
77.26 .addGroup(androidPanelLayout.createSequentialGroup()
77.27 .addContainerGap()
77.28 + .addComponent(androidSdkLabel)
77.29 + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.30 .addGroup(androidPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
77.31 .addGroup(androidPanelLayout.createSequentialGroup()
77.32 - .addComponent(androidSdkLabel)
77.33 - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.34 .addComponent(androidSdkField)
77.35 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.36 .addComponent(androidSdkBrowse))
77.37 - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, androidPanelLayout.createSequentialGroup()
77.38 - .addGap(0, 0, Short.MAX_VALUE)
77.39 + .addGroup(androidPanelLayout.createSequentialGroup()
77.40 + .addGap(6, 6, 6)
77.41 + .addComponent(androidVersion)
77.42 + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
77.43 .addComponent(androidSdkDownload, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
77.44 .addContainerGap())
77.45 );
77.46 @@ -144,7 +147,9 @@
77.47 .addComponent(androidSdkField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
77.48 .addComponent(androidSdkBrowse))
77.49 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.50 - .addComponent(androidSdkDownload, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
77.51 + .addGroup(androidPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
77.52 + .addComponent(androidSdkDownload, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
77.53 + .addComponent(androidVersion))
77.54 .addGap(22, 22, 22))
77.55 );
77.56
77.57 @@ -170,15 +175,17 @@
77.58 cordovaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
77.59 .addGroup(cordovaPanelLayout.createSequentialGroup()
77.60 .addContainerGap()
77.61 + .addComponent(cordovaSdkLabel)
77.62 + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.63 .addGroup(cordovaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
77.64 .addGroup(cordovaPanelLayout.createSequentialGroup()
77.65 - .addComponent(cordovaSdkLabel)
77.66 - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.67 .addComponent(cordovaSdkField, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE)
77.68 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.69 .addComponent(cordovaSdkBrowse))
77.70 - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, cordovaPanelLayout.createSequentialGroup()
77.71 - .addGap(0, 0, Short.MAX_VALUE)
77.72 + .addGroup(cordovaPanelLayout.createSequentialGroup()
77.73 + .addGap(6, 6, 6)
77.74 + .addComponent(phonegapVersion)
77.75 + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
77.76 .addComponent(cordovaSdkDownload, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
77.77 .addContainerGap())
77.78 );
77.79 @@ -191,7 +198,9 @@
77.80 .addComponent(cordovaSdkField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
77.81 .addComponent(cordovaSdkBrowse))
77.82 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
77.83 - .addComponent(cordovaSdkDownload, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
77.84 + .addGroup(cordovaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
77.85 + .addComponent(cordovaSdkDownload, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
77.86 + .addComponent(phonegapVersion))
77.87 .addContainerGap(28, Short.MAX_VALUE))
77.88 );
77.89
77.90 @@ -264,18 +273,31 @@
77.91 CordovaPlatform.getDefault().setSdkLocation(cordovaSdkField.getText());
77.92 }
77.93
77.94 + @NbBundle.Messages(
77.95 + "ERR_PhoneGapVersion=Version {0} is not supported. (2.4 or greater required)"
77.96 + )
77.97 boolean valid() {
77.98 File androidLoc = new File(androidSdkField.getText());
77.99 File androidTools = new File(androidLoc, "tools"); //NOI18N
77.100 boolean adroidValid = androidSdkField.getText().isEmpty() || (androidLoc.exists() && androidLoc.isDirectory()
77.101 && androidTools.exists() && androidTools.isDirectory());
77.102
77.103 - File cordovaLoc = new File(cordovaSdkField.getText());
77.104 - File cordovaAndroid = new File(cordovaLoc, "lib/android"); //NOI18N
77.105 - File cordovaIOS = new File(cordovaLoc, "lib/ios"); //NOI18N
77.106 - boolean cordovaValid = androidSdkField.getText().isEmpty() || (cordovaLoc.exists() && cordovaLoc.isDirectory()
77.107 - && cordovaAndroid.exists() && cordovaAndroid.isDirectory()
77.108 - && cordovaIOS.exists() && cordovaIOS.isDirectory()) ;
77.109 +
77.110 + boolean cordovaSdkValid = true;
77.111 + if (!cordovaSdkField.getText().trim().isEmpty()) {
77.112 + try {
77.113 + CordovaPlatform.Version v = CordovaPlatform.getVersion(cordovaSdkField.getText());
77.114 + if (v.isSupported()) {
77.115 + phonegapVersion.setText("");
77.116 + } else {
77.117 + phonegapVersion.setText(Bundle.ERR_PhoneGapVersion(v));
77.118 + cordovaSdkValid = false;
77.119 + }
77.120 + } catch (IllegalArgumentException ex) {
77.121 + cordovaSdkValid = false;
77.122 + }
77.123 + }
77.124 + boolean cordovaValid = cordovaSdkValid;
77.125
77.126 return adroidValid && cordovaValid;
77.127 }
77.128 @@ -285,10 +307,12 @@
77.129 private javax.swing.JLabel androidSdkDownload;
77.130 private javax.swing.JTextField androidSdkField;
77.131 private javax.swing.JLabel androidSdkLabel;
77.132 + private javax.swing.JLabel androidVersion;
77.133 private javax.swing.JPanel cordovaPanel;
77.134 private javax.swing.JButton cordovaSdkBrowse;
77.135 private javax.swing.JLabel cordovaSdkDownload;
77.136 private javax.swing.JTextField cordovaSdkField;
77.137 private javax.swing.JLabel cordovaSdkLabel;
77.138 + private javax.swing.JLabel phonegapVersion;
77.139 // End of variables declaration//GEN-END:variables
77.140 }
78.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
78.2 +++ b/cordova/src/org/netbeans/modules/cordova/project/ClientProjectNodeFactory.java Wed Feb 20 15:23:50 2013 +0100
78.3 @@ -0,0 +1,165 @@
78.4 +/*
78.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
78.6 + *
78.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
78.8 + *
78.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
78.10 + * Other names may be trademarks of their respective owners.
78.11 + *
78.12 + * The contents of this file are subject to the terms of either the GNU
78.13 + * General Public License Version 2 only ("GPL") or the Common
78.14 + * Development and Distribution License("CDDL") (collectively, the
78.15 + * "License"). You may not use this file except in compliance with the
78.16 + * License. You can obtain a copy of the License at
78.17 + * http://www.netbeans.org/cddl-gplv2.html
78.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
78.19 + * specific language governing permissions and limitations under the
78.20 + * License. When distributing the software, include this License Header
78.21 + * Notice in each file and include the License file at
78.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
78.23 + * particular file as subject to the "Classpath" exception as provided
78.24 + * by Oracle in the GPL Version 2 section of the License file that
78.25 + * accompanied this code. If applicable, add the following below the
78.26 + * License Header, with the fields enclosed by brackets [] replaced by
78.27 + * your own identifying information:
78.28 + * "Portions Copyrighted [year] [name of copyright owner]"
78.29 + *
78.30 + * If you wish your version of this file to be governed by only the CDDL
78.31 + * or only the GPL Version 2, indicate your decision by adding
78.32 + * "[Contributor] elects to include this software in this distribution
78.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
78.34 + * single choice of license, a recipient has the option to distribute
78.35 + * your version of this file under either the CDDL, the GPL Version 2 or
78.36 + * to extend the choice of license to its licensees as provided above.
78.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
78.38 + * Version 2 license, then the option applies only if the new code is
78.39 + * made subject to such option by the copyright holder.
78.40 + *
78.41 + * Contributor(s):
78.42 + *
78.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
78.44 + */
78.45 +package org.netbeans.modules.cordova.project;
78.46 +
78.47 +import java.util.Collection;
78.48 +import java.util.Collections;
78.49 +import java.util.List;
78.50 +import javax.swing.event.ChangeListener;
78.51 +import javax.swing.event.EventListenerList;
78.52 +import org.netbeans.api.project.Project;
78.53 +import org.netbeans.spi.project.ui.support.NodeFactory;
78.54 +import org.netbeans.spi.project.ui.support.NodeList;
78.55 +import org.openide.filesystems.FileAttributeEvent;
78.56 +import org.openide.filesystems.FileChangeListener;
78.57 +import org.openide.filesystems.FileEvent;
78.58 +import org.openide.filesystems.FileObject;
78.59 +import org.openide.filesystems.FileRenameEvent;
78.60 +import org.openide.loaders.DataFolder;
78.61 +import org.openide.loaders.DataObject;
78.62 +import org.openide.loaders.DataObjectNotFoundException;
78.63 +import org.openide.nodes.Node;
78.64 +import org.openide.util.ChangeSupport;
78.65 +import org.openide.util.Exceptions;
78.66 +
78.67 +/**
78.68 + *
78.69 + * @author Jan Becicka
78.70 + */
78.71 +@NodeFactory.Registration(projectType = "org-netbeans-modules-web-clientproject", position = 800)
78.72 +public class ClientProjectNodeFactory implements NodeFactory {
78.73 +
78.74 +
78.75 + @Override
78.76 + public NodeList<?> createNodes(Project p) {
78.77 + return new PlatformsSingleton(p);
78.78 + }
78.79 +
78.80 + private static class PlatformsSingleton implements NodeList, FileChangeListener {
78.81 +
78.82 + private static Object key = "platforms";
78.83 +
78.84 + private ChangeSupport changeSupport = new ChangeSupport(this);
78.85 +
78.86 + private FileObject root;
78.87 +
78.88 + public PlatformsSingleton(Project p) {
78.89 + root = p.getProjectDirectory();
78.90 +
78.91 + root.addFileChangeListener(this);
78.92 + }
78.93 +
78.94 +
78.95 + @Override
78.96 + public void fileFolderCreated(FileEvent fe) {
78.97 + changeSupport.fireChange();
78.98 + }
78.99 +
78.100 + @Override
78.101 + public void fileDataCreated(FileEvent fe) {
78.102 + }
78.103 +
78.104 + @Override
78.105 + public void fileChanged(FileEvent fe) {
78.106 + }
78.107 +
78.108 + @Override
78.109 + public void fileDeleted(FileEvent fe) {
78.110 + changeSupport.fireChange();
78.111 + }
78.112 +
78.113 + @Override
78.114 + public void fileRenamed(FileRenameEvent fe) {
78.115 + changeSupport.fireChange();
78.116 + }
78.117 +
78.118 + @Override
78.119 + public void fileAttributeChanged(FileAttributeEvent fe) {
78.120 + }
78.121 +
78.122 + @Override
78.123 + public List keys() {
78.124 + FileObject platforms = root.getFileObject("platforms");
78.125 + if (platforms != null) {
78.126 + return Collections.singletonList(key);
78.127 + } else {
78.128 + return Collections.emptyList();
78.129 + }
78.130 + }
78.131 +
78.132 + @Override
78.133 + public void addChangeListener(ChangeListener l) {
78.134 + changeSupport.addChangeListener(l);
78.135 + }
78.136 +
78.137 + @Override
78.138 + public void removeChangeListener(ChangeListener l) {
78.139 + changeSupport.removeChangeListener(l);
78.140 + }
78.141 +
78.142 + @Override
78.143 + public Node node(Object k) {
78.144 + if (key.equals(k)) {
78.145 + FileObject platforms = root.getFileObject("platforms");
78.146 + if (platforms != null) {
78.147 + try {
78.148 + DataObject dob = DataObject.find(platforms);
78.149 + return dob.getNodeDelegate();
78.150 + } catch (DataObjectNotFoundException ex) {
78.151 + Exceptions.printStackTrace(ex);
78.152 + }
78.153 + }
78.154 + }
78.155 + return null;
78.156 + }
78.157 +
78.158 + @Override
78.159 + public void addNotify() {
78.160 + }
78.161 +
78.162 + @Override
78.163 + public void removeNotify() {
78.164 + }
78.165 + }
78.166 +
78.167 +
78.168 +}
79.1 --- a/cordova/src/org/netbeans/modules/cordova/project/ClientProjectUtilities.java Tue Feb 19 16:39:13 2013 +0100
79.2 +++ b/cordova/src/org/netbeans/modules/cordova/project/ClientProjectUtilities.java Wed Feb 20 15:23:50 2013 +0100
79.3 @@ -79,6 +79,8 @@
79.4
79.5 public static String getProperty(Project p, String key) {
79.6 ProjectConfigurationProvider provider = p.getLookup().lookup(ProjectConfigurationProvider.class);
79.7 + if (!(provider.getActiveConfiguration() instanceof ClientProjectConfigurationImpl))
79.8 + return null;
79.9 ClientProjectConfigurationImpl activeConfiguration = (ClientProjectConfigurationImpl) provider.getActiveConfiguration();
79.10 return activeConfiguration.getProperty(key);
79.11 }
80.1 --- a/cordova/src/org/netbeans/modules/cordova/project/CordovaCustomizerPanel.java Tue Feb 19 16:39:13 2013 +0100
80.2 +++ b/cordova/src/org/netbeans/modules/cordova/project/CordovaCustomizerPanel.java Wed Feb 20 15:23:50 2013 +0100
80.3 @@ -57,6 +57,7 @@
80.4 import org.netbeans.spi.project.ProjectConfigurationProvider;
80.5 import org.openide.util.EditableProperties;
80.6 import org.openide.util.Exceptions;
80.7 +import org.openide.util.Lookup;
80.8
80.9 /**
80.10 *
80.11 @@ -202,5 +203,9 @@
80.12
80.13 CordovaPerformer.storeBuildProperties(project, props);
80.14
80.15 + if (cordovaPanel.isPanelEnabled()) {
80.16 + Lookup.getDefault().lookup(CordovaPerformer.class).perform("create-android", project);
80.17 + Lookup.getDefault().lookup(CordovaPerformer.class).perform("create-ios", project);
80.18 + }
80.19 }
80.20 }
81.1 --- a/cordova/src/org/netbeans/modules/cordova/template/CordovaTemplate.java Tue Feb 19 16:39:13 2013 +0100
81.2 +++ b/cordova/src/org/netbeans/modules/cordova/template/CordovaTemplate.java Wed Feb 20 15:23:50 2013 +0100
81.3 @@ -71,6 +71,7 @@
81.4 import org.openide.util.EditableProperties;
81.5 import org.openide.util.Exceptions;
81.6 import org.openide.util.HelpCtx;
81.7 +import org.openide.util.Lookup;
81.8 import org.openide.util.NbBundle;
81.9 import org.openide.util.lookup.ServiceProvider;
81.10
81.11 @@ -98,7 +99,7 @@
81.12 DataObject find = DataObject.find(index);
81.13 EditorCookie c = find.getLookup().lookup(EditorCookie.class);
81.14 StyledDocument openDocument = c.openDocument();
81.15 - String version = CordovaPlatform.getDefault().getVersion();
81.16 + String version = CordovaPlatform.getDefault().getVersion().toString();
81.17 final String cordova = "cordova-" + version + ".js";//NOI18N
81.18 int start = openDocument.getText(0, openDocument.getLength()).indexOf(cordova);
81.19 openDocument.remove(start, cordova.length());
81.20 @@ -185,7 +186,7 @@
81.21 return;
81.22 }
81.23 try {
81.24 - String version = CordovaPlatform.getDefault().getVersion();
81.25 + String version = CordovaPlatform.getDefault().getVersion().toString();
81.26
81.27 final String sdkLocation = CordovaPlatform.getDefault().getSdkLocation();
81.28 File lib = new File(sdkLocation + "/lib/android/cordova-"+version +".js");//NOI18N
81.29 @@ -203,6 +204,8 @@
81.30 props.put("android.project.package.folder", panel.getPackageName().replace(".", "/"));//NOI18N
81.31
81.32 CordovaPerformer.storeBuildProperties(project, props);
81.33 + Lookup.getDefault().lookup(CordovaPerformer.class).perform("create-android", project);
81.34 + Lookup.getDefault().lookup(CordovaPerformer.class).perform("create-ios", project);
81.35 panel = null;
81.36 }
81.37 } catch (IOException ex) {
82.1 --- a/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemoteDirectory.java Tue Feb 19 16:39:13 2013 +0100
82.2 +++ b/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemoteDirectory.java Wed Feb 20 15:23:50 2013 +0100
82.3 @@ -480,8 +480,21 @@
82.4 }
82.5 }
82.6
82.7 - private static final Collection<String> AUTO_MOUNTS = Arrays.asList("/net", "/set", "/import", "/shared", "/home", "/ade_autofs", "/ade"); //NOI18N
82.8 -
82.9 + private static final Collection<String> AUTO_MOUNTS;
82.10 + static {
82.11 + List<String> list = new ArrayList<String>(Arrays.asList("/net", "/set", "/import", "/shared", "/home", "/ade_autofs", "/ade", "/workspace")); //NOI18N
82.12 + String t = System.getProperty("remote.autofs.list"); //NOI18N
82.13 + if (t != null) {
82.14 + String[] paths = t.split(","); //NOI18N
82.15 + for (String p : paths) {
82.16 + if (p.startsWith("/")) { //NOI18N
82.17 + list.add(p);
82.18 + }
82.19 + }
82.20 + }
82.21 + AUTO_MOUNTS = Collections.unmodifiableList(list);
82.22 + }
82.23 +
82.24 private boolean isProhibited() {
82.25 return getPath().equals("/proc");//NOI18N
82.26 }
83.1 --- a/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemotePlainFile.java Tue Feb 19 16:39:13 2013 +0100
83.2 +++ b/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemotePlainFile.java Wed Feb 20 15:23:50 2013 +0100
83.3 @@ -434,6 +434,11 @@
83.4 // Fixing #206726 - If a remote file is saved frequently, "File modified externally" message appears, user changes are lost
83.5 @Override
83.6 protected void refreshImpl(boolean recursive, Set<String> antiLoop, boolean expected) throws ConnectException, IOException, InterruptedException, CancellationException, ExecutionException {
83.7 + if (Boolean.getBoolean("cnd.remote.refresh.plain.file")) { //NOI18N
83.8 + long time = System.currentTimeMillis();
83.9 + getParent().refreshImpl(false, antiLoop, expected);
83.10 + RemoteLogger.getInstance().log(Level.FINE, "Refreshing {0} took {1} ms", new Object[] { getPath(), System.currentTimeMillis() - time });
83.11 + }
83.12 if (RemoteFileObjectBase.DEFER_WRITES) {
83.13 WritingQueue.getInstance(getExecutionEnvironment()).waitFinished(Collections.<FileObject>singleton(this.getOwnerFileObject()), null);
83.14 }
84.1 --- a/editor.lib/src/org/netbeans/editor/ActionFactory.java Tue Feb 19 16:39:13 2013 +0100
84.2 +++ b/editor.lib/src/org/netbeans/editor/ActionFactory.java Wed Feb 20 15:23:50 2013 +0100
84.3 @@ -93,7 +93,7 @@
84.4 import org.netbeans.lib.editor.util.swing.PositionRegion;
84.5 import org.netbeans.modules.editor.indent.api.Indent;
84.6 import org.netbeans.modules.editor.indent.api.Reformat;
84.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
84.8 +import org.netbeans.api.editor.NavigationHistory;
84.9 import org.netbeans.modules.editor.lib2.RectangularSelectionUtils;
84.10 import org.netbeans.modules.editor.lib2.view.DocumentView;
84.11 import org.openide.util.ContextAwareAction;
85.1 --- a/editor.lib/src/org/netbeans/editor/BaseKit.java Tue Feb 19 16:39:13 2013 +0100
85.2 +++ b/editor.lib/src/org/netbeans/editor/BaseKit.java Wed Feb 20 15:23:50 2013 +0100
85.3 @@ -102,7 +102,7 @@
85.4 import org.netbeans.modules.editor.lib2.EditorPreferencesDefaults;
85.5 import org.netbeans.modules.editor.lib2.EditorPreferencesKeys;
85.6 import org.netbeans.modules.editor.lib.KitsTracker;
85.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
85.8 +import org.netbeans.api.editor.NavigationHistory;
85.9 import org.netbeans.modules.editor.lib.SettingsConversions;
85.10 import org.netbeans.modules.editor.lib2.RectangularSelectionUtils;
85.11 import org.netbeans.modules.editor.lib2.actions.KeyBindingsUpdater;
85.12 @@ -1749,6 +1749,12 @@
85.13 protected boolean nextChar;
85.14
85.15 static final long serialVersionUID =-4321971925753148556L;
85.16 +
85.17 + /**
85.18 + * This may be used to overcome a JDK bug on Mac OS X (NB issue #219853).
85.19 + */
85.20 + private static final boolean disableDeleteFromScreenMenu = Boolean.TRUE.equals(
85.21 + Boolean.getBoolean("netbeans.editor.disable.delete.from.screen.menu"));
85.22
85.23 public DeleteCharAction(String nm, boolean nextChar) {
85.24 super(nm, MAGIC_POSITION_RESET | ABBREV_RESET | WORD_MATCH_RESET);
85.25 @@ -1757,6 +1763,10 @@
85.26
85.27 public void actionPerformed(final ActionEvent evt, final JTextComponent target) {
85.28 if (target != null) {
85.29 + // ScreenMenuItem from screen menu on Mac OS X should extend java.awt.MenuItem
85.30 + if (disableDeleteFromScreenMenu && (evt.getSource() instanceof java.awt.MenuItem)) {
85.31 + return;
85.32 + }
85.33 if (!target.isEditable() || !target.isEnabled()) {
85.34 target.getToolkit().beep();
85.35 return;
86.1 --- a/editor.lib/src/org/netbeans/editor/JumpList.java Tue Feb 19 16:39:13 2013 +0100
86.2 +++ b/editor.lib/src/org/netbeans/editor/JumpList.java Wed Feb 20 15:23:50 2013 +0100
86.3 @@ -52,7 +52,7 @@
86.4 import java.util.logging.Logger;
86.5 import javax.swing.text.JTextComponent;
86.6 import javax.swing.text.BadLocationException;
86.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
86.8 +import org.netbeans.api.editor.NavigationHistory;
86.9 import org.openide.modules.PatchedPublic;
86.10 import org.openide.util.WeakListeners;
86.11
87.1 --- a/editor.lib/src/org/netbeans/editor/ext/ExtKit.java Tue Feb 19 16:39:13 2013 +0100
87.2 +++ b/editor.lib/src/org/netbeans/editor/ext/ExtKit.java Wed Feb 20 15:23:50 2013 +0100
87.3 @@ -69,7 +69,7 @@
87.4 import org.netbeans.editor.SyntaxSupport;
87.5 import org.netbeans.lib.editor.util.CharSequenceUtilities;
87.6 import org.netbeans.lib.editor.util.swing.DocumentUtilities;
87.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
87.8 +import org.netbeans.api.editor.NavigationHistory;
87.9 import org.netbeans.api.editor.EditorActionNames;
87.10 import org.openide.util.Lookup;
87.11 import org.openide.util.NbBundle;
88.1 --- a/editor.lib/src/org/netbeans/modules/editor/lib/NavigationHistory.java Tue Feb 19 16:39:13 2013 +0100
88.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
88.3 @@ -1,498 +0,0 @@
88.4 -/*
88.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
88.6 - *
88.7 - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
88.8 - *
88.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
88.10 - * Other names may be trademarks of their respective owners.
88.11 - *
88.12 - * The contents of this file are subject to the terms of either the GNU
88.13 - * General Public License Version 2 only ("GPL") or the Common
88.14 - * Development and Distribution License("CDDL") (collectively, the
88.15 - * "License"). You may not use this file except in compliance with the
88.16 - * License. You can obtain a copy of the License at
88.17 - * http://www.netbeans.org/cddl-gplv2.html
88.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
88.19 - * specific language governing permissions and limitations under the
88.20 - * License. When distributing the software, include this License Header
88.21 - * Notice in each file and include the License file at
88.22 - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
88.23 - * particular file as subject to the "Classpath" exception as provided
88.24 - * by Oracle in the GPL Version 2 section of the License file that
88.25 - * accompanied this code. If applicable, add the following below the
88.26 - * License Header, with the fields enclosed by brackets [] replaced by
88.27 - * your own identifying information:
88.28 - * "Portions Copyrighted [year] [name of copyright owner]"
88.29 - *
88.30 - * Contributor(s):
88.31 - *
88.32 - * The Original Software is NetBeans. The Initial Developer of the Original
88.33 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
88.34 - * Microsystems, Inc. All Rights Reserved.
88.35 - *
88.36 - * If you wish your version of this file to be governed by only the CDDL
88.37 - * or only the GPL Version 2, indicate your decision by adding
88.38 - * "[Contributor] elects to include this software in this distribution
88.39 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
88.40 - * single choice of license, a recipient has the option to distribute
88.41 - * your version of this file under either the CDDL, the GPL Version 2 or
88.42 - * to extend the choice of license to its licensees as provided above.
88.43 - * However, if you add GPL Version 2 code and therefore, elected the GPL
88.44 - * Version 2 license, then the option applies only if the new code is
88.45 - * made subject to such option by the copyright holder.
88.46 - */
88.47 -
88.48 -package org.netbeans.modules.editor.lib;
88.49 -
88.50 -import java.beans.PropertyChangeListener;
88.51 -import java.beans.PropertyChangeSupport;
88.52 -import java.lang.ref.Reference;
88.53 -import java.lang.ref.WeakReference;
88.54 -import java.net.URL;
88.55 -import java.util.AbstractList;
88.56 -import java.util.ArrayList;
88.57 -import java.util.Collections;
88.58 -import java.util.HashMap;
88.59 -import java.util.List;
88.60 -import java.util.Map;
88.61 -import java.util.logging.Level;
88.62 -import java.util.logging.Logger;
88.63 -import javax.swing.text.BadLocationException;
88.64 -import javax.swing.text.JTextComponent;
88.65 -import javax.swing.text.Position;
88.66 -
88.67 -/**
88.68 - * 0 1 2 3 4 waypoints.size()
88.69 - * | W1 | W2 | W3 | W4 | W5 |
88.70 - * ^
88.71 - * |
88.72 - * previous waypoints <- pointer -> next Waypoints
88.73 - * current waypoint
88.74 - *
88.75 - * getPreviousWaypoints() == { W1, W2, W3 }
88.76 - * getNextWaypoints() == { W4, W5 }
88.77 - * navigateBack() == W3, moves pointer one position left
88.78 - * navigateForward() == W4, moves pointer one position right
88.79 - *
88.80 - *
88.81 - * @author Vita Stejskal
88.82 - */
88.83 -public final class NavigationHistory {
88.84 -
88.85 - public static final String PROP_WAYPOINTS = "NavigationHHistory.PROP_WAYPOINTS"; //NOI18N
88.86 -
88.87 - public static NavigationHistory getNavigations() {
88.88 - return get("navigation-history"); //NOI18N
88.89 - }
88.90 -
88.91 - public static NavigationHistory getEdits() {
88.92 - return get("last-edit-history"); //NOI18N
88.93 - }
88.94 -
88.95 - public void addPropertyChangeListener(PropertyChangeListener l) {
88.96 - PCS.addPropertyChangeListener(l);
88.97 - }
88.98 -
88.99 - public void removePropertyChangeListener(PropertyChangeListener l) {
88.100 - PCS.removePropertyChangeListener(l);
88.101 - }
88.102 -
88.103 - /**
88.104 - * @param offset A valid ofset inside the component's document or -1 if the
88.105 - * offset is unspecified.
88.106 - */
88.107 - public Waypoint markWaypoint(JTextComponent comp, int offset, boolean currentPosition, boolean append) throws BadLocationException {
88.108 - assert comp != null : "The comp parameter must not be null"; //NOI18N
88.109 - if (comp.getClientProperty("AsTextField") != null) {
88.110 - return null;
88.111 - }
88.112 - Waypoint newWpt = null;
88.113 -
88.114 - synchronized (LOCK) {
88.115 - // Get the current position
88.116 - Position pos = offset == -1 ? null : WeakPositions.get(comp.getDocument(), offset);
88.117 -
88.118 - // Remove all next waypoints and the current waypoint
88.119 - if (!append) {
88.120 - while (waypoints.size() > pointer) {
88.121 - Waypoint wpt = waypoints.remove(waypoints.size() - 1);
88.122 - wpt.dispose();
88.123 - }
88.124 - }
88.125 -
88.126 - // compare the new position with the current waypoint
88.127 - if (waypoints.size() > 0) {
88.128 - Waypoint wpt = waypoints.get(waypoints.size() - 1);
88.129 - JTextComponent wptComp = wpt.getComponent();
88.130 - int wptOffset = wpt.getOffset();
88.131 - if (wptComp != null && wptComp.equals(comp) && wptOffset == offset) {
88.132 - // Current waypoint has the same position, do not add anything
88.133 - newWpt = wpt;
88.134 - }
88.135 - }
88.136 -
88.137 - if (newWpt == null) {
88.138 - // Add the new Waypoint
88.139 - newWpt = new Waypoint(this, comp, pos);
88.140 - int rawIndex = waypoints.addEx(newWpt);
88.141 - newWpt.initRawIndex(rawIndex);
88.142 - }
88.143 -
88.144 - // Update the pointer
88.145 - if (currentPosition) {
88.146 - pointer = waypoints.size() - 1;
88.147 - } else {
88.148 - pointer = waypoints.size();
88.149 - }
88.150 -
88.151 - // Reset the cache
88.152 - sublistsCache = null;
88.153 - }
88.154 -
88.155 - PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
88.156 -
88.157 - return newWpt;
88.158 - }
88.159 -
88.160 - public Waypoint getCurrentWaypoint() {
88.161 - synchronized (LOCK) {
88.162 - if (pointer < waypoints.size()) {
88.163 - return waypoints.get(pointer);
88.164 - } else {
88.165 - return null;
88.166 - }
88.167 - }
88.168 - }
88.169 -
88.170 - public boolean hasPreviousWaypoints() {
88.171 - synchronized (LOCK) {
88.172 - return pointer > 0;
88.173 - }
88.174 - }
88.175 -
88.176 - public boolean hasNextWaypoints() {
88.177 - synchronized (LOCK) {
88.178 - return pointer + 1 < waypoints.size();
88.179 - }
88.180 - }
88.181 -
88.182 - public List<Waypoint> getPreviousWaypoints() {
88.183 - synchronized (LOCK) {
88.184 - if (hasPreviousWaypoints()) {
88.185 - return getSublistsCache().subList(0, pointer);
88.186 - } else {
88.187 - return Collections.<Waypoint>emptyList();
88.188 - }
88.189 - }
88.190 - }
88.191 -
88.192 - public List<Waypoint> getNextWaypoints() {
88.193 - synchronized (LOCK) {
88.194 - if (hasNextWaypoints()) {
88.195 - return getSublistsCache().subList(pointer + 1, waypoints.size());
88.196 - } else {
88.197 - return Collections.<Waypoint>emptyList();
88.198 - }
88.199 - }
88.200 - }
88.201 -
88.202 - public Waypoint navigateBack() {
88.203 - Waypoint waypoint = null;
88.204 -
88.205 - synchronized (LOCK) {
88.206 - if (hasPreviousWaypoints()) {
88.207 - pointer--;
88.208 - waypoint = waypoints.get(pointer);
88.209 - }
88.210 - }
88.211 -
88.212 - if (waypoint != null) {
88.213 - PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
88.214 - }
88.215 -
88.216 - return waypoint;
88.217 - }
88.218 -
88.219 - public Waypoint navigateForward() {
88.220 - Waypoint waypoint = null;
88.221 -
88.222 - synchronized (LOCK) {
88.223 - if (hasNextWaypoints()) {
88.224 - pointer++;
88.225 - waypoint = waypoints.get(pointer);
88.226 - }
88.227 - }
88.228 -
88.229 - if (waypoint != null) {
88.230 - PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
88.231 - }
88.232 -
88.233 - return waypoint;
88.234 - }
88.235 -
88.236 - public Waypoint navigateTo(Waypoint waypoint) {
88.237 - assert waypoint != null : "The waypoint parameter must not be null"; //NOI18N
88.238 -
88.239 - synchronized (LOCK) {
88.240 - int rawIndex = waypoint.getRawIndex();
88.241 - if (rawIndex == -1) {
88.242 - // invalid waypoint
88.243 - waypoint = null;
88.244 - } else {
88.245 - int wptPointer = waypoints.getIndex(rawIndex);
88.246 - if (pointer != wptPointer) {
88.247 - // Move to the waypoint
88.248 - pointer = wptPointer;
88.249 - } else {
88.250 - // We are already there no need for navigation
88.251 - waypoint = null;
88.252 - }
88.253 - }
88.254 - }
88.255 -
88.256 - if (waypoint != null) {
88.257 - PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
88.258 - }
88.259 -
88.260 - return waypoint;
88.261 - }
88.262 -
88.263 - public Waypoint navigateFirst() {
88.264 - Waypoint waypoint = null;
88.265 -
88.266 - synchronized (LOCK) {
88.267 - if (waypoints.size() > 0) {
88.268 - pointer = 0;
88.269 - waypoint = waypoints.get(pointer);
88.270 - }
88.271 - }
88.272 -
88.273 - if (waypoint != null) {
88.274 - PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
88.275 - }
88.276 -
88.277 - return waypoint;
88.278 - }
88.279 -
88.280 - public Waypoint navigateLast() {
88.281 - Waypoint waypoint = null;
88.282 -
88.283 - synchronized (LOCK) {
88.284 - if (waypoints.size() > 0) {
88.285 - pointer = waypoints.size() - 1;
88.286 - waypoint = waypoints.get(pointer);
88.287 - }
88.288 - }
88.289 -
88.290 - if (waypoint != null) {
88.291 - PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
88.292 - }
88.293 -
88.294 - return waypoint;
88.295 - }
88.296 -
88.297 - public static final class Waypoint {
88.298 -
88.299 - private NavigationHistory navigationHistory;
88.300 - private Reference<JTextComponent> compRef;
88.301 - private Position pos;
88.302 - private URL url;
88.303 -
88.304 - private int rawIndex = -2;
88.305 -
88.306 - private Waypoint(NavigationHistory nh, JTextComponent comp, Position pos) throws BadLocationException {
88.307 - this.navigationHistory = nh;
88.308 - this.compRef = new WeakReference<JTextComponent>(comp);
88.309 - this.pos = pos;
88.310 - this.url = URLMapper.findUrl(comp);
88.311 -
88.312 - if (LOG.isLoggable(Level.FINE)) {
88.313 - LOG.fine(navigationHistory.id + ": waypoint added: " + getUrl()); //NOI18N
88.314 - }
88.315 - }
88.316 -
88.317 - public URL getUrl() {
88.318 - synchronized (navigationHistory.LOCK) {
88.319 - return url;
88.320 - }
88.321 - }
88.322 -
88.323 - public JTextComponent getComponent() {
88.324 - synchronized (navigationHistory.LOCK) {
88.325 - return compRef == null ? null : compRef.get();
88.326 - }
88.327 - }
88.328 -
88.329 - public int getOffset() {
88.330 - synchronized (navigationHistory.LOCK) {
88.331 - return pos == null ? -1 : pos.getOffset();
88.332 - }
88.333 - }
88.334 -
88.335 - // the following methods are called under the getDefault().LOCK
88.336 -
88.337 - private int getRawIndex() {
88.338 - return rawIndex;
88.339 - }
88.340 -
88.341 - private void initRawIndex(int rawIndex) {
88.342 - assert this.rawIndex == -2 : "Can't call initRawIndex more than once."; //NOI18N
88.343 - this.rawIndex = rawIndex;
88.344 - }
88.345 -
88.346 - private void dispose() {
88.347 - if (LOG.isLoggable(Level.FINE)) {
88.348 - LOG.fine(navigationHistory.id + ": waypoint disposed: " + getUrl()); //NOI18N
88.349 - }
88.350 -
88.351 - this.rawIndex = -1;
88.352 - this.url = null;
88.353 - this.compRef = null;
88.354 - this.pos = null;
88.355 - }
88.356 - } // End of Waypoint class
88.357 -
88.358 - // ----------------------------------------------
88.359 - // Private implementation
88.360 - // ----------------------------------------------
88.361 -
88.362 - private static final Logger LOG = Logger.getLogger(NavigationHistory.class.getName());
88.363 -
88.364 - private static final Map<String, NavigationHistory> instances = new HashMap<String, NavigationHistory>();
88.365 -
88.366 - private final String id;
88.367 - private final String LOCK = new String("NavigationHistory.LOCK"); //NOI18N
88.368 - private final RingBuffer<Waypoint> waypoints = new RingBuffer<Waypoint>(new Waypoint [50]);
88.369 - private int pointer = 0;
88.370 - private List<Waypoint> sublistsCache = null;
88.371 -
88.372 - private final PropertyChangeSupport PCS = new PropertyChangeSupport(this);
88.373 -
88.374 - private static NavigationHistory get(String id) {
88.375 - synchronized (instances) {
88.376 - NavigationHistory nh = instances.get(id);
88.377 -
88.378 - if (nh == null) {
88.379 - nh = new NavigationHistory(id);
88.380 - instances.put(id, nh);
88.381 - }
88.382 -
88.383 - return nh;
88.384 - }
88.385 - }
88.386 -
88.387 - private NavigationHistory(String id) {
88.388 - this.id = id;
88.389 - }
88.390 -
88.391 - private List<Waypoint> getSublistsCache() {
88.392 - if (sublistsCache == null) {
88.393 - sublistsCache = Collections.unmodifiableList(new ArrayList<Waypoint>(waypoints));
88.394 - }
88.395 - return sublistsCache;
88.396 - }
88.397 -
88.398 - private static final class RingBuffer<E> extends AbstractList<E> {
88.399 -
88.400 - private final E [] buffer;
88.401 - private int head = 0;
88.402 - private int tail = 0;
88.403 -
88.404 - public RingBuffer(E [] buffer) {
88.405 - assert buffer != null : "The buffer parameter must not be null"; //NOI18N
88.406 - assert buffer.length >= 2 : "The buffer size must be at least 2."; //NOI18N
88.407 -
88.408 - this.buffer = buffer;
88.409 - }
88.410 -
88.411 - @Override
88.412 - public E set(int index, E element) {
88.413 - int rawIndex = getRawIndex(index);
88.414 - E old = buffer[rawIndex];
88.415 - buffer[rawIndex] = element;
88.416 - return old;
88.417 - }
88.418 -
88.419 - @Override
88.420 - public void add(int index, E element) {
88.421 - int rawIndex = (head + index) % buffer.length;
88.422 - if (rawIndex == tail) {
88.423 - addEx(element);
88.424 - } else {
88.425 - throw new UnsupportedOperationException("This ring buffer only allows adding to the end of the buffer."); //NOI18N
88.426 - }
88.427 - }
88.428 -
88.429 - public int addEx(E element) {
88.430 - int rawIndex = tail;
88.431 - buffer[rawIndex] = element;
88.432 -
88.433 - tail = (tail + 1) % buffer.length;
88.434 - if (tail == head) {
88.435 - // XXX: hack, not very nice
88.436 - if (buffer[head] instanceof Waypoint) {
88.437 - ((Waypoint) buffer[head]).dispose();
88.438 - }
88.439 - buffer[head] = null;
88.440 - head = (head + 1) % buffer.length;
88.441 - }
88.442 -
88.443 - return rawIndex;
88.444 - }
88.445 -
88.446 - @Override
88.447 - public E remove(int index) {
88.448 - int rawIndex = getRawIndex(index);
88.449 -
88.450 - if (rawIndex == head) {
88.451 - head = (head + 1) % buffer.length;
88.452 - } else {
88.453 - int tailMinusOne = (tail - 1 + buffer.length) % buffer.length;
88.454 - if (rawIndex == tailMinusOne) {
88.455 - tail = tailMinusOne;
88.456 - } else {
88.457 - throw new UnsupportedOperationException("This ring buffer only allows removing at the beginning or end of the buffer."); //NOI18N
88.458 - }
88.459 - }
88.460 -
88.461 - E old = buffer[rawIndex];
88.462 - buffer[rawIndex] = null;
88.463 -
88.464 - return old;
88.465 - }
88.466 -
88.467 - @Override
88.468 - public E get(int index) {
88.469 - return buffer[getRawIndex(index)];
88.470 - }
88.471 -
88.472 - public int size() {
88.473 - return (tail - head + buffer.length) % buffer.length;
88.474 - }
88.475 -
88.476 - private int getRawIndex(int index) {
88.477 - if (index >= 0 && index < size()) {
88.478 - return (head + index) % buffer.length;
88.479 - } else {
88.480 - throw new IndexOutOfBoundsException("Index = " + index + ", size = " + size());
88.481 - }
88.482 - }
88.483 -
88.484 - public int getIndex(int rawIndex) {
88.485 - boolean valid;
88.486 -
88.487 - if (tail < head) {
88.488 - valid = (rawIndex >= 0 && rawIndex < tail) || (rawIndex >= head && rawIndex < buffer.length);
88.489 - } else {
88.490 - valid = rawIndex >= head && rawIndex < tail;
88.491 - }
88.492 -
88.493 - if (valid) {
88.494 - return (rawIndex - head + buffer.length) % buffer.length;
88.495 - } else {
88.496 - throw new IndexOutOfBoundsException("Invalid raw index. RawIndex = " + rawIndex + ", head = " + head + ", tail = " + tail);
88.497 - }
88.498 - }
88.499 - } // End of RingBuffer class
88.500 -
88.501 -}
89.1 --- a/editor.lib/src/org/netbeans/modules/editor/lib/URLMapper.java Tue Feb 19 16:39:13 2013 +0100
89.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
89.3 @@ -1,108 +0,0 @@
89.4 -/*
89.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
89.6 - *
89.7 - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
89.8 - *
89.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
89.10 - * Other names may be trademarks of their respective owners.
89.11 - *
89.12 - * The contents of this file are subject to the terms of either the GNU
89.13 - * General Public License Version 2 only ("GPL") or the Common
89.14 - * Development and Distribution License("CDDL") (collectively, the
89.15 - * "License"). You may not use this file except in compliance with the
89.16 - * License. You can obtain a copy of the License at
89.17 - * http://www.netbeans.org/cddl-gplv2.html
89.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
89.19 - * specific language governing permissions and limitations under the
89.20 - * License. When distributing the software, include this License Header
89.21 - * Notice in each file and include the License file at
89.22 - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
89.23 - * particular file as subject to the "Classpath" exception as provided
89.24 - * by Oracle in the GPL Version 2 section of the License file that
89.25 - * accompanied this code. If applicable, add the following below the
89.26 - * License Header, with the fields enclosed by brackets [] replaced by
89.27 - * your own identifying information:
89.28 - * "Portions Copyrighted [year] [name of copyright owner]"
89.29 - *
89.30 - * Contributor(s):
89.31 - *
89.32 - * The Original Software is NetBeans. The Initial Developer of the Original
89.33 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
89.34 - * Microsystems, Inc. All Rights Reserved.
89.35 - *
89.36 - * If you wish your version of this file to be governed by only the CDDL
89.37 - * or only the GPL Version 2, indicate your decision by adding
89.38 - * "[Contributor] elects to include this software in this distribution
89.39 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
89.40 - * single choice of license, a recipient has the option to distribute
89.41 - * your version of this file under either the CDDL, the GPL Version 2 or
89.42 - * to extend the choice of license to its licensees as provided above.
89.43 - * However, if you add GPL Version 2 code and therefore, elected the GPL
89.44 - * Version 2 license, then the option applies only if the new code is
89.45 - * made subject to such option by the copyright holder.
89.46 - */
89.47 -
89.48 -package org.netbeans.modules.editor.lib;
89.49 -
89.50 -import java.net.URL;
89.51 -import java.util.Collection;
89.52 -import javax.swing.text.JTextComponent;
89.53 -import org.openide.util.Lookup;
89.54 -
89.55 -/**
89.56 - *
89.57 - * @author Vita Stejskal
89.58 - */
89.59 -public abstract class URLMapper {
89.60 -
89.61 - public static JTextComponent findTextComponenet(URL url) {
89.62 - synchronized (LOCK) {
89.63 - Collection<? extends URLMapper> mappers = getMappers();
89.64 - for(URLMapper m : mappers) {
89.65 - JTextComponent jtc = m.getTextComponent(url);
89.66 - if (jtc != null) {
89.67 - return jtc;
89.68 - }
89.69 - }
89.70 - return null;
89.71 - }
89.72 - }
89.73 -
89.74 - public static URL findUrl(JTextComponent component) {
89.75 - synchronized (LOCK) {
89.76 - Collection<? extends URLMapper> mappers = getMappers();
89.77 - for(URLMapper m : mappers) {
89.78 - URL url = m.getUrl(component);
89.79 - if (url != null) {
89.80 - return url;
89.81 - }
89.82 - }
89.83 - return null;
89.84 - }
89.85 - }
89.86 -
89.87 - // ----------------------------------------------
89.88 - // Abstract URLMapper
89.89 - // ----------------------------------------------
89.90 -
89.91 - protected URLMapper() {
89.92 - }
89.93 -
89.94 - protected abstract JTextComponent getTextComponent(URL url);
89.95 -
89.96 - protected abstract URL getUrl(JTextComponent url);
89.97 -
89.98 - // ----------------------------------------------
89.99 - // Private implementation
89.100 - // ----------------------------------------------
89.101 -
89.102 - private static final String LOCK = new String("URLMapper.LOCK"); //NOI18N
89.103 - private static Lookup.Result<URLMapper> mappers = null;
89.104 -
89.105 - private static Collection<? extends URLMapper> getMappers() {
89.106 - if (mappers == null) {
89.107 - mappers = Lookup.getDefault().lookupResult(URLMapper.class);
89.108 - }
89.109 - return mappers.allInstances();
89.110 - }
89.111 -}
90.1 --- a/editor.lib/src/org/netbeans/modules/editor/lib/WeakPositions.java Tue Feb 19 16:39:13 2013 +0100
90.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
90.3 @@ -1,146 +0,0 @@
90.4 -/*
90.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
90.6 - *
90.7 - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
90.8 - *
90.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
90.10 - * Other names may be trademarks of their respective owners.
90.11 - *
90.12 - * The contents of this file are subject to the terms of either the GNU
90.13 - * General Public License Version 2 only ("GPL") or the Common
90.14 - * Development and Distribution License("CDDL") (collectively, the
90.15 - * "License"). You may not use this file except in compliance with the
90.16 - * License. You can obtain a copy of the License at
90.17 - * http://www.netbeans.org/cddl-gplv2.html
90.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
90.19 - * specific language governing permissions and limitations under the
90.20 - * License. When distributing the software, include this License Header
90.21 - * Notice in each file and include the License file at
90.22 - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
90.23 - * particular file as subject to the "Classpath" exception as provided
90.24 - * by Oracle in the GPL Version 2 section of the License file that
90.25 - * accompanied this code. If applicable, add the following below the
90.26 - * License Header, with the fields enclosed by brackets [] replaced by
90.27 - * your own identifying information:
90.28 - * "Portions Copyrighted [year] [name of copyright owner]"
90.29 - *
90.30 - * Contributor(s):
90.31 - *
90.32 - * The Original Software is NetBeans. The Initial Developer of the Original
90.33 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
90.34 - * Microsystems, Inc. All Rights Reserved.
90.35 - *
90.36 - * If you wish your version of this file to be governed by only the CDDL
90.37 - * or only the GPL Version 2, indicate your decision by adding
90.38 - * "[Contributor] elects to include this software in this distribution
90.39 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
90.40 - * single choice of license, a recipient has the option to distribute
90.41 - * your version of this file under either the CDDL, the GPL Version 2 or
90.42 - * to extend the choice of license to its licensees as provided above.
90.43 - * However, if you add GPL Version 2 code and therefore, elected the GPL
90.44 - * Version 2 license, then the option applies only if the new code is
90.45 - * made subject to such option by the copyright holder.
90.46 - */
90.47 -
90.48 -package org.netbeans.modules.editor.lib;
90.49 -
90.50 -import java.util.Map;
90.51 -import java.util.WeakHashMap;
90.52 -import javax.swing.event.DocumentEvent;
90.53 -import javax.swing.event.DocumentListener;
90.54 -import javax.swing.text.BadLocationException;
90.55 -import javax.swing.text.Document;
90.56 -import javax.swing.text.Position;
90.57 -import org.netbeans.modules.editor.lib2.highlighting.OffsetGapList;
90.58 -import org.openide.util.WeakListeners;
90.59 -
90.60 -/**
90.61 - *
90.62 - * @author Vita Stejskal
90.63 - */
90.64 -public final class WeakPositions {
90.65 -
90.66 - /**
90.67 - * Gets a <code>Position</code> in the document at the given offset. The
90.68 - * position is automatically updated when the document's contents is modified.
90.69 - * The <code>Position</code> does not reference the document in anyway that
90.70 - * would prevent the document from being garbage collected.
90.71 - *
90.72 - * @param doc The document to get a position in.
90.73 - * @param offset The initial offset of the position.
90.74 - *
90.75 - * @return A <code>Position</code> inside the document.
90.76 - * @throws BadLocationException If the offset is not valid for the document.
90.77 - */
90.78 - public static Position get(Document doc, int offset) throws BadLocationException {
90.79 - // Check that the offset is valid. This should excercise any rule imposed by
90.80 - // the document on its positions.
90.81 - doc.createPosition(offset);
90.82 -
90.83 - synchronized (OGLS) {
90.84 - OffsetGapList<WeakP> ogl = OGLS.get(doc);
90.85 -
90.86 - if (ogl == null) {
90.87 - ogl = new OffsetGapList<WeakPositions.WeakP>();
90.88 - OGLS.put(doc, ogl);
90.89 - doc.addDocumentListener(WeakListeners.document(documentsTracker, doc));
90.90 - }
90.91 -
90.92 - int index = ogl.findElementIndex(offset);
90.93 - WeakP pos = index >= 0 ? ogl.get(index) : null;
90.94 -
90.95 - if (pos == null) {
90.96 - pos = new WeakP(offset);
90.97 - ogl.add(pos);
90.98 - }
90.99 -
90.100 - return pos;
90.101 - }
90.102 - }
90.103 -
90.104 - // ----------------------------------------------
90.105 - // Private implementation
90.106 - // ----------------------------------------------
90.107 -
90.108 - private static final Map<Document,OffsetGapList<WeakP>> OGLS = new WeakHashMap<Document,OffsetGapList<WeakP>>();
90.109 -
90.110 - private static final DocumentListener documentsTracker = new DocumentListener() {
90.111 -
90.112 - public void insertUpdate(DocumentEvent e) {
90.113 - synchronized (OGLS) {
90.114 - OffsetGapList<WeakPositions.WeakP> ogl = getOgl(e);
90.115 - if (ogl != null) {
90.116 - ogl.defaultInsertUpdate(e.getOffset(), e.getLength());
90.117 - }
90.118 - }
90.119 - }
90.120 -
90.121 - public void removeUpdate(DocumentEvent e) {
90.122 - synchronized (OGLS) {
90.123 - OffsetGapList<WeakPositions.WeakP> ogl = getOgl(e);
90.124 - if (ogl != null) {
90.125 - ogl.defaultRemoveUpdate(e.getOffset(), e.getLength());
90.126 - }
90.127 - }
90.128 - }
90.129 -
90.130 - public void changedUpdate(DocumentEvent e) {
90.131 - // attribute's changed, ignore
90.132 - }
90.133 -
90.134 - private OffsetGapList<WeakPositions.WeakP> getOgl(DocumentEvent e) {
90.135 - Document doc = e.getDocument();
90.136 - return OGLS.get(doc);
90.137 - }
90.138 - };
90.139 -
90.140 - private WeakPositions() {
90.141 -
90.142 - }
90.143 -
90.144 - private static final class WeakP extends OffsetGapList.Offset implements Position {
90.145 - public WeakP(int offset) {
90.146 - super(offset);
90.147 - }
90.148 - } // End of WeakP class
90.149 -}
91.1 --- a/editor.lib/test/unit/src/org/netbeans/editor/BaseDocumentTest.java Tue Feb 19 16:39:13 2013 +0100
91.2 +++ b/editor.lib/test/unit/src/org/netbeans/editor/BaseDocumentTest.java Wed Feb 20 15:23:50 2013 +0100
91.3 @@ -32,6 +32,7 @@
91.4
91.5 import java.beans.PropertyChangeEvent;
91.6 import java.beans.PropertyChangeListener;
91.7 +import java.lang.ref.WeakReference;
91.8 import java.util.LinkedList;
91.9 import java.util.List;
91.10 import javax.swing.event.DocumentEvent;
91.11 @@ -253,6 +254,22 @@
91.12 fail("Failed sleep");
91.13 }
91.14 }
91.15 +
91.16 + public void testReleaseDocAndHoldPosition() throws Exception {
91.17 + releaseDocAndHoldPosition(new BaseDocument(false, "text/plain")); // NOI18N
91.18 + releaseDocAndHoldPosition(new PlainDocument()); // NOI18N
91.19 + }
91.20 +
91.21 + private void releaseDocAndHoldPosition(Document doc) throws Exception {
91.22 + doc.insertString(0, "Nazdar", null);
91.23 + Position pos = doc.createPosition(3);
91.24 + doc.insertString(2, "abc", null);
91.25 + assertEquals(6, pos.getOffset());
91.26 + WeakReference<Document> docRef = new WeakReference<Document>(doc);
91.27 + doc = null;
91.28 + assertGC("Doc not released", docRef);
91.29 + assertEquals(6, pos.getOffset()); // Doc released but position can still be referenced
91.30 + }
91.31
91.32 public void testBackwardBiasPosition() throws Exception {
91.33 BaseDocument doc = new BaseDocument(false, "text/plain"); // NOI18N
92.1 --- a/editor.lib2/apichanges.xml Tue Feb 19 16:39:13 2013 +0100
92.2 +++ b/editor.lib2/apichanges.xml Wed Feb 20 15:23:50 2013 +0100
92.3 @@ -107,8 +107,23 @@
92.4 <!-- ACTUAL CHANGES BEGIN HERE: -->
92.5
92.6 <changes>
92.7 + <change id="NavigationHistoryClassAdded">
92.8 + <summary>NavigationHistory class added</summary>
92.9 + <version major="1" minor="74"/>
92.10 + <date day="15" month="2" year="2013"/>
92.11 + <author login="mkristofic"/>
92.12 + <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/>
92.13 + <description>
92.14 + <p>
92.15 + Added NavigationHistory and NavigationHistory.Waypoint classes. It enables to add position to
92.16 + edit history. It also enables get edit history and look on last edits.
92.17 + </p>
92.18 + </description>
92.19 + <issue number="225808"/>
92.20 + </change>
92.21 +
92.22 <change id="TypedTextInterceptor.getReplacedText">
92.23 - <summary>OnSaveTask interface added</summary>
92.24 + <summary>method getReplacedText added</summary>
92.25 <version major="1" minor="73"/>
92.26 <date day="30" month="1" year="2013"/>
92.27 <author login="mkristofic"/>
93.1 --- a/editor.lib2/nbproject/project.properties Tue Feb 19 16:39:13 2013 +0100
93.2 +++ b/editor.lib2/nbproject/project.properties Wed Feb 20 15:23:50 2013 +0100
93.3 @@ -43,7 +43,7 @@
93.4 is.autoload=true
93.5 javac.source=1.6
93.6 javac.compilerargs=-Xlint:unchecked
93.7 -spec.version.base=1.73.0
93.8 +spec.version.base=1.74.0
93.9
93.10 javadoc.arch=${basedir}/arch.xml
93.11 javadoc.apichanges=${basedir}/apichanges.xml
94.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
94.2 +++ b/editor.lib2/src/org/netbeans/api/editor/NavigationHistory.java Wed Feb 20 15:23:50 2013 +0100
94.3 @@ -0,0 +1,541 @@
94.4 +/*
94.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
94.6 + *
94.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
94.8 + *
94.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
94.10 + * Other names may be trademarks of their respective owners.
94.11 + *
94.12 + * The contents of this file are subject to the terms of either the GNU
94.13 + * General Public License Version 2 only ("GPL") or the Common
94.14 + * Development and Distribution License("CDDL") (collectively, the
94.15 + * "License"). You may not use this file except in compliance with the
94.16 + * License. You can obtain a copy of the License at
94.17 + * http://www.netbeans.org/cddl-gplv2.html
94.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
94.19 + * specific language governing permissions and limitations under the
94.20 + * License. When distributing the software, include this License Header
94.21 + * Notice in each file and include the License file at
94.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
94.23 + * particular file as subject to the "Classpath" exception as provided
94.24 + * by Oracle in the GPL Version 2 section of the License file that
94.25 + * accompanied this code. If applicable, add the following below the
94.26 + * License Header, with the fields enclosed by brackets [] replaced by
94.27 + * your own identifying information:
94.28 + * "Portions Copyrighted [year] [name of copyright owner]"
94.29 + *
94.30 + * Contributor(s):
94.31 + *
94.32 + * The Original Software is NetBeans. The Initial Developer of the Original
94.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
94.34 + * Microsystems, Inc. All Rights Reserved.
94.35 + *
94.36 + * If you wish your version of this file to be governed by only the CDDL
94.37 + * or only the GPL Version 2, indicate your decision by adding
94.38 + * "[Contributor] elects to include this software in this distribution
94.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
94.40 + * single choice of license, a recipient has the option to distribute
94.41 + * your version of this file under either the CDDL, the GPL Version 2 or
94.42 + * to extend the choice of license to its licensees as provided above.
94.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
94.44 + * Version 2 license, then the option applies only if the new code is
94.45 + * made subject to such option by the copyright holder.
94.46 + */
94.47 +
94.48 +package org.netbeans.api.editor;
94.49 +
94.50 +import java.beans.PropertyChangeListener;
94.51 +import java.beans.PropertyChangeSupport;
94.52 +import java.lang.ref.Reference;
94.53 +import java.lang.ref.WeakReference;
94.54 +import java.net.URL;
94.55 +import java.util.AbstractList;
94.56 +import java.util.ArrayList;
94.57 +import java.util.Collections;
94.58 +import java.util.HashMap;
94.59 +import java.util.List;
94.60 +import java.util.Map;
94.61 +import java.util.logging.Level;
94.62 +import java.util.logging.Logger;
94.63 +import javax.swing.text.BadLocationException;
94.64 +import javax.swing.text.JTextComponent;
94.65 +import javax.swing.text.Position;
94.66 +import org.netbeans.modules.editor.lib2.URLMapper;
94.67 +import org.netbeans.modules.editor.lib2.WeakPositions;
94.68 +
94.69 +/**
94.70 + * 0 1 2 3 4 waypoints.size()
94.71 + * | W1 | W2 | W3 | W4 | W5 |
94.72 + * ^
94.73 + * |
94.74 + * previous waypoints <- pointer -> next Waypoints
94.75 + * current waypoint
94.76 + *
94.77 + * getPreviousWaypoints() == { W1, W2, W3 }
94.78 + * getNextWaypoints() == { W4, W5 }
94.79 + * navigateBack() == W3, moves pointer one position left
94.80 + * navigateForward() == W4, moves pointer one position right
94.81 + *
94.82 + * @since 1.74
94.83 + * @author Vita Stejskal
94.84 + */
94.85 +public final class NavigationHistory {
94.86 +
94.87 + public static final String PROP_WAYPOINTS = "NavigationHHistory.PROP_WAYPOINTS"; //NOI18N
94.88 +
94.89 + /**
94.90 + * @return list of waypoints where user navigated.
94.91 + */
94.92 + public static NavigationHistory getNavigations() {
94.93 + return get("navigation-history"); //NOI18N
94.94 + }
94.95 +
94.96 + /**
94.97 + * @return list of waypoints where user edited content.
94.98 + */
94.99 + public static NavigationHistory getEdits() {
94.100 + return get("last-edit-history"); //NOI18N
94.101 + }
94.102 +
94.103 + public void addPropertyChangeListener(PropertyChangeListener l) {
94.104 + PCS.addPropertyChangeListener(l);
94.105 + }
94.106 +
94.107 + public void removePropertyChangeListener(PropertyChangeListener l) {
94.108 + PCS.removePropertyChangeListener(l);
94.109 + }
94.110 +
94.111 + /**
94.112 + * Create and add new waypoint to navigation history
94.113 + * @param offset A valid ofset inside the component's document or -1 if the
94.114 + * offset is unspecified.
94.115 + */
94.116 + public Waypoint markWaypoint(JTextComponent comp, int offset, boolean currentPosition, boolean append) throws BadLocationException {
94.117 + assert comp != null : "The comp parameter must not be null"; //NOI18N
94.118 + if (comp.getClientProperty("AsTextField") != null) {
94.119 + return null;
94.120 + }
94.121 + Waypoint newWpt = null;
94.122 +
94.123 + synchronized (LOCK) {
94.124 + // Get the current position
94.125 + Position pos = offset == -1 ? null : WeakPositions.get(comp.getDocument(), offset);
94.126 +
94.127 + // Remove all next waypoints and the current waypoint
94.128 + if (!append) {
94.129 + while (waypoints.size() > pointer) {
94.130 + Waypoint wpt = waypoints.remove(waypoints.size() - 1);
94.131 + wpt.dispose();
94.132 + }
94.133 + }
94.134 +
94.135 + // compare the new position with the current waypoint
94.136 + if (waypoints.size() > 0) {
94.137 + Waypoint wpt = waypoints.get(waypoints.size() - 1);
94.138 + JTextComponent wptComp = wpt.getComponent();
94.139 + int wptOffset = wpt.getOffset();
94.140 + if (wptComp != null && wptComp.equals(comp) && wptOffset == offset) {
94.141 + // Current waypoint has the same position, do not add anything
94.142 + newWpt = wpt;
94.143 + }
94.144 + }
94.145 +
94.146 + if (newWpt == null) {
94.147 + // Add the new Waypoint
94.148 + newWpt = new Waypoint(this, comp, pos);
94.149 + int rawIndex = waypoints.addEx(newWpt);
94.150 + newWpt.initRawIndex(rawIndex);
94.151 + }
94.152 +
94.153 + // Update the pointer
94.154 + if (currentPosition) {
94.155 + pointer = waypoints.size() - 1;
94.156 + } else {
94.157 + pointer = waypoints.size();
94.158 + }
94.159 +
94.160 + // Reset the cache
94.161 + sublistsCache = null;
94.162 + }
94.163 +
94.164 + PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
94.165 +
94.166 + return newWpt;
94.167 + }
94.168 +
94.169 + /**
94.170 + * @return waypoint under pointer
94.171 + */
94.172 + public Waypoint getCurrentWaypoint() {
94.173 + synchronized (LOCK) {
94.174 + if (pointer < waypoints.size()) {
94.175 + return waypoints.get(pointer);
94.176 + } else {
94.177 + return null;
94.178 + }
94.179 + }
94.180 + }
94.181 +
94.182 + /**
94.183 + * Is pointer showing other than first waypoint entry
94.184 + */
94.185 + public boolean hasPreviousWaypoints() {
94.186 + synchronized (LOCK) {
94.187 + return pointer > 0;
94.188 + }
94.189 + }
94.190 +
94.191 + /**
94.192 + * Is pointer showing other than last waypoint entry
94.193 + */
94.194 + public boolean hasNextWaypoints() {
94.195 + synchronized (LOCK) {
94.196 + return pointer + 1 < waypoints.size();
94.197 + }
94.198 + }
94.199 +
94.200 + /**
94.201 + * @return all waypoints before waypoint under pointer
94.202 + */
94.203 + public List<Waypoint> getPreviousWaypoints() {
94.204 + synchronized (LOCK) {
94.205 + if (hasPreviousWaypoints()) {
94.206 + return getSublistsCache().subList(0, pointer);
94.207 + } else {
94.208 + return Collections.<Waypoint>emptyList();
94.209 + }
94.210 + }
94.211 + }
94.212 +
94.213 + /**
94.214 + * @return all waypoints after waypoint under pointer
94.215 + */
94.216 + public List<Waypoint> getNextWaypoints() {
94.217 + synchronized (LOCK) {
94.218 + if (hasNextWaypoints()) {
94.219 + return getSublistsCache().subList(pointer + 1, waypoints.size());
94.220 + } else {
94.221 + return Collections.<Waypoint>emptyList();
94.222 + }
94.223 + }
94.224 + }
94.225 +
94.226 + /**
94.227 + * Change selected waypoint by moving pointer to previous waypoint
94.228 + */
94.229 + public Waypoint navigateBack() {
94.230 + Waypoint waypoint = null;
94.231 +
94.232 + synchronized (LOCK) {
94.233 + if (hasPreviousWaypoints()) {
94.234 + pointer--;
94.235 + waypoint = waypoints.get(pointer);
94.236 + }
94.237 + }
94.238 +
94.239 + if (waypoint != null) {
94.240 + PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
94.241 + }
94.242 +
94.243 + return waypoint;
94.244 + }
94.245 +
94.246 + /**
94.247 + * Change selected waypoint by moving pointer to next waypoint
94.248 + */
94.249 + public Waypoint navigateForward() {
94.250 + Waypoint waypoint = null;
94.251 +
94.252 + synchronized (LOCK) {
94.253 + if (hasNextWaypoints()) {
94.254 + pointer++;
94.255 + waypoint = waypoints.get(pointer);
94.256 + }
94.257 + }
94.258 +
94.259 + if (waypoint != null) {
94.260 + PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
94.261 + }
94.262 +
94.263 + return waypoint;
94.264 + }
94.265 +
94.266 + /**
94.267 + * Change selected waypoint by moving pointer to waypoint in parameter
94.268 + */
94.269 + public Waypoint navigateTo(Waypoint waypoint) {
94.270 + assert waypoint != null : "The waypoint parameter must not be null"; //NOI18N
94.271 +
94.272 + synchronized (LOCK) {
94.273 + int rawIndex = waypoint.getRawIndex();
94.274 + if (rawIndex == -1) {
94.275 + // invalid waypoint
94.276 + waypoint = null;
94.277 + } else {
94.278 + int wptPointer = waypoints.getIndex(rawIndex);
94.279 + if (pointer != wptPointer) {
94.280 + // Move to the waypoint
94.281 + pointer = wptPointer;
94.282 + } else {
94.283 + // We are already there no need for navigation
94.284 + waypoint = null;
94.285 + }
94.286 + }
94.287 + }
94.288 +
94.289 + if (waypoint != null) {
94.290 + PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
94.291 + }
94.292 +
94.293 + return waypoint;
94.294 + }
94.295 +
94.296 + /**
94.297 + * Change selected waypoint by moving pointer to first waypoint
94.298 + */
94.299 + public Waypoint navigateFirst() {
94.300 + Waypoint waypoint = null;
94.301 +
94.302 + synchronized (LOCK) {
94.303 + if (waypoints.size() > 0) {
94.304 + pointer = 0;
94.305 + waypoint = waypoints.get(pointer);
94.306 + }
94.307 + }
94.308 +
94.309 + if (waypoint != null) {
94.310 + PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
94.311 + }
94.312 +
94.313 + return waypoint;
94.314 + }
94.315 +
94.316 + /**
94.317 + * Change selected waypoint by moving pointer to last waypoint
94.318 + */
94.319 + public Waypoint navigateLast() {
94.320 + Waypoint waypoint = null;
94.321 +
94.322 + synchronized (LOCK) {
94.323 + if (waypoints.size() > 0) {
94.324 + pointer = waypoints.size() - 1;
94.325 + waypoint = waypoints.get(pointer);
94.326 + }
94.327 + }
94.328 +
94.329 + if (waypoint != null) {
94.330 + PCS.firePropertyChange(PROP_WAYPOINTS, null, null);
94.331 + }
94.332 +
94.333 + return waypoint;
94.334 + }
94.335 +
94.336 + /*
94.337 + * @since 1.74
94.338 + */
94.339 + public static final class Waypoint {
94.340 +
94.341 + private final NavigationHistory navigationHistory;
94.342 + private Reference<JTextComponent> compRef;
94.343 + private Position pos;
94.344 + private URL url;
94.345 +
94.346 + private int rawIndex = -2;
94.347 +
94.348 + private Waypoint(NavigationHistory nh, JTextComponent comp, Position pos) throws BadLocationException {
94.349 + this.navigationHistory = nh;
94.350 + this.compRef = new WeakReference<JTextComponent>(comp);
94.351 + this.pos = pos;
94.352 + this.url = URLMapper.findUrl(comp);
94.353 +
94.354 + if (LOG.isLoggable(Level.FINE)) {
94.355 + LOG.fine(navigationHistory.id + ": waypoint added: " + getUrl()); //NOI18N
94.356 + }
94.357 + }
94.358 +
94.359 + public URL getUrl() {
94.360 + synchronized (navigationHistory.LOCK) {
94.361 + return url;
94.362 + }
94.363 + }
94.364 +
94.365 + public JTextComponent getComponent() {
94.366 + synchronized (navigationHistory.LOCK) {
94.367 + return compRef == null ? null : compRef.get();
94.368 + }
94.369 + }
94.370 +
94.371 + public int getOffset() {
94.372 + synchronized (navigationHistory.LOCK) {
94.373 + return pos == null ? -1 : pos.getOffset();
94.374 + }
94.375 + }
94.376 +
94.377 + // the following methods are called under the getDefault().LOCK
94.378 +
94.379 + private int getRawIndex() {
94.380 + return rawIndex;
94.381 + }
94.382 +
94.383 + private void initRawIndex(int rawIndex) {
94.384 + assert this.rawIndex == -2 : "Can't call initRawIndex more than once."; //NOI18N
94.385 + this.rawIndex = rawIndex;
94.386 + }
94.387 +
94.388 + private void dispose() {
94.389 + if (LOG.isLoggable(Level.FINE)) {
94.390 + LOG.fine(navigationHistory.id + ": waypoint disposed: " + getUrl()); //NOI18N
94.391 + }
94.392 +
94.393 + this.rawIndex = -1;
94.394 + this.url = null;
94.395 + this.compRef = null;
94.396 + this.pos = null;
94.397 + }
94.398 + } // End of Waypoint class
94.399 +
94.400 + // ----------------------------------------------
94.401 + // Private implementation
94.402 + // ----------------------------------------------
94.403 +
94.404 + private static final Logger LOG = Logger.getLogger(NavigationHistory.class.getName());
94.405 +
94.406 + private static final Map<String, NavigationHistory> instances = new HashMap<String, NavigationHistory>();
94.407 +
94.408 + private final String id;
94.409 + private final String LOCK = new String("NavigationHistory.LOCK"); //NOI18N
94.410 + private final RingBuffer<Waypoint> waypoints = new RingBuffer<Waypoint>(new Waypoint [50]);
94.411 + private int pointer = 0;
94.412 + private List<Waypoint> sublistsCache = null;
94.413 +
94.414 + private final PropertyChangeSupport PCS = new PropertyChangeSupport(this);
94.415 +
94.416 + private static NavigationHistory get(String id) {
94.417 + synchronized (instances) {
94.418 + NavigationHistory nh = instances.get(id);
94.419 +
94.420 + if (nh == null) {
94.421 + nh = new NavigationHistory(id);
94.422 + instances.put(id, nh);
94.423 + }
94.424 +
94.425 + return nh;
94.426 + }
94.427 + }
94.428 +
94.429 + private NavigationHistory(String id) {
94.430 + this.id = id;
94.431 + }
94.432 +
94.433 + private List<Waypoint> getSublistsCache() {
94.434 + if (sublistsCache == null) {
94.435 + sublistsCache = Collections.unmodifiableList(new ArrayList<Waypoint>(waypoints));
94.436 + }
94.437 + return sublistsCache;
94.438 + }
94.439 +
94.440 + private static final class RingBuffer<E> extends AbstractList<E> {
94.441 +
94.442 + private final E [] buffer;
94.443 + private int head = 0;
94.444 + private int tail = 0;
94.445 +
94.446 + public RingBuffer(E [] buffer) {
94.447 + assert buffer != null : "The buffer parameter must not be null"; //NOI18N
94.448 + assert buffer.length >= 2 : "The buffer size must be at least 2."; //NOI18N
94.449 +
94.450 + this.buffer = buffer;
94.451 + }
94.452 +
94.453 + @Override
94.454 + public E set(int index, E element) {
94.455 + int rawIndex = getRawIndex(index);
94.456 + E old = buffer[rawIndex];
94.457 + buffer[rawIndex] = element;
94.458 + return old;
94.459 + }
94.460 +
94.461 + @Override
94.462 + public void add(int index, E element) {
94.463 + int rawIndex = (head + index) % buffer.length;
94.464 + if (rawIndex == tail) {
94.465 + addEx(element);
94.466 + } else {
94.467 + throw new UnsupportedOperationException("This ring buffer only allows adding to the end of the buffer."); //NOI18N
94.468 + }
94.469 + }
94.470 +
94.471 + public int addEx(E element) {
94.472 + int rawIndex = tail;
94.473 + buffer[rawIndex] = element;
94.474 +
94.475 + tail = (tail + 1) % buffer.length;
94.476 + if (tail == head) {
94.477 + // XXX: hack, not very nice
94.478 + if (buffer[head] instanceof Waypoint) {
94.479 + ((Waypoint) buffer[head]).dispose();
94.480 + }
94.481 + buffer[head] = null;
94.482 + head = (head + 1) % buffer.length;
94.483 + }
94.484 +
94.485 + return rawIndex;
94.486 + }
94.487 +
94.488 + @Override
94.489 + public E remove(int index) {
94.490 + int rawIndex = getRawIndex(index);
94.491 +
94.492 + if (rawIndex == head) {
94.493 + head = (head + 1) % buffer.length;
94.494 + } else {
94.495 + int tailMinusOne = (tail - 1 + buffer.length) % buffer.length;
94.496 + if (rawIndex == tailMinusOne) {
94.497 + tail = tailMinusOne;
94.498 + } else {
94.499 + throw new UnsupportedOperationException("This ring buffer only allows removing at the beginning or end of the buffer."); //NOI18N
94.500 + }
94.501 + }
94.502 +
94.503 + E old = buffer[rawIndex];
94.504 + buffer[rawIndex] = null;
94.505 +
94.506 + return old;
94.507 + }
94.508 +
94.509 + @Override
94.510 + public E get(int index) {
94.511 + return buffer[getRawIndex(index)];
94.512 + }
94.513 +
94.514 + @Override
94.515 + public int size() {
94.516 + return (tail - head + buffer.length) % buffer.length;
94.517 + }
94.518 +
94.519 + private int getRawIndex(int index) {
94.520 + if (index >= 0 && index < size()) {
94.521 + return (head + index) % buffer.length;
94.522 + } else {
94.523 + throw new IndexOutOfBoundsException("Index = " + index + ", size = " + size());
94.524 + }
94.525 + }
94.526 +
94.527 + public int getIndex(int rawIndex) {
94.528 + boolean valid;
94.529 +
94.530 + if (tail < head) {
94.531 + valid = (rawIndex >= 0 && rawIndex < tail) || (rawIndex >= head && rawIndex < buffer.length);
94.532 + } else {
94.533 + valid = rawIndex >= head && rawIndex < tail;
94.534 + }
94.535 +
94.536 + if (valid) {
94.537 + return (rawIndex - head + buffer.length) % buffer.length;
94.538 + } else {
94.539 + throw new IndexOutOfBoundsException("Invalid raw index. RawIndex = " + rawIndex + ", head = " + head + ", tail = " + tail);
94.540 + }
94.541 + }
94.542 + } // End of RingBuffer class
94.543 +
94.544 +}
95.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
95.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/URLMapper.java Wed Feb 20 15:23:50 2013 +0100
95.3 @@ -0,0 +1,108 @@
95.4 +/*
95.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
95.6 + *
95.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
95.8 + *
95.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
95.10 + * Other names may be trademarks of their respective owners.
95.11 + *
95.12 + * The contents of this file are subject to the terms of either the GNU
95.13 + * General Public License Version 2 only ("GPL") or the Common
95.14 + * Development and Distribution License("CDDL") (collectively, the
95.15 + * "License"). You may not use this file except in compliance with the
95.16 + * License. You can obtain a copy of the License at
95.17 + * http://www.netbeans.org/cddl-gplv2.html
95.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
95.19 + * specific language governing permissions and limitations under the
95.20 + * License. When distributing the software, include this License Header
95.21 + * Notice in each file and include the License file at
95.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
95.23 + * particular file as subject to the "Classpath" exception as provided
95.24 + * by Oracle in the GPL Version 2 section of the License file that
95.25 + * accompanied this code. If applicable, add the following below the
95.26 + * License Header, with the fields enclosed by brackets [] replaced by
95.27 + * your own identifying information:
95.28 + * "Portions Copyrighted [year] [name of copyright owner]"
95.29 + *
95.30 + * Contributor(s):
95.31 + *
95.32 + * The Original Software is NetBeans. The Initial Developer of the Original
95.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
95.34 + * Microsystems, Inc. All Rights Reserved.
95.35 + *
95.36 + * If you wish your version of this file to be governed by only the CDDL
95.37 + * or only the GPL Version 2, indicate your decision by adding
95.38 + * "[Contributor] elects to include this software in this distribution
95.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
95.40 + * single choice of license, a recipient has the option to distribute
95.41 + * your version of this file under either the CDDL, the GPL Version 2 or
95.42 + * to extend the choice of license to its licensees as provided above.
95.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
95.44 + * Version 2 license, then the option applies only if the new code is
95.45 + * made subject to such option by the copyright holder.
95.46 + */
95.47 +
95.48 +package org.netbeans.modules.editor.lib2;
95.49 +
95.50 +import java.net.URL;
95.51 +import java.util.Collection;
95.52 +import javax.swing.text.JTextComponent;
95.53 +import org.openide.util.Lookup;
95.54 +
95.55 +/**
95.56 + *
95.57 + * @author Vita Stejskal
95.58 + */
95.59 +public abstract class URLMapper {
95.60 +
95.61 + public static JTextComponent findTextComponenet(URL url) {
95.62 + synchronized (LOCK) {
95.63 + Collection<? extends URLMapper> mappers = getMappers();
95.64 + for(URLMapper m : mappers) {
95.65 + JTextComponent jtc = m.getTextComponent(url);
95.66 + if (jtc != null) {
95.67 + return jtc;
95.68 + }
95.69 + }
95.70 + return null;
95.71 + }
95.72 + }
95.73 +
95.74 + public static URL findUrl(JTextComponent component) {
95.75 + synchronized (LOCK) {
95.76 + Collection<? extends URLMapper> mappers = getMappers();
95.77 + for(URLMapper m : mappers) {
95.78 + URL url = m.getUrl(component);
95.79 + if (url != null) {
95.80 + return url;
95.81 + }
95.82 + }
95.83 + return null;
95.84 + }
95.85 + }
95.86 +
95.87 + // ----------------------------------------------
95.88 + // Abstract URLMapper
95.89 + // ----------------------------------------------
95.90 +
95.91 + protected URLMapper() {
95.92 + }
95.93 +
95.94 + protected abstract JTextComponent getTextComponent(URL url);
95.95 +
95.96 + protected abstract URL getUrl(JTextComponent url);
95.97 +
95.98 + // ----------------------------------------------
95.99 + // Private implementation
95.100 + // ----------------------------------------------
95.101 +
95.102 + private static final String LOCK = new String("URLMapper.LOCK"); //NOI18N
95.103 + private static Lookup.Result<URLMapper> mappers = null;
95.104 +
95.105 + private static Collection<? extends URLMapper> getMappers() {
95.106 + if (mappers == null) {
95.107 + mappers = Lookup.getDefault().lookupResult(URLMapper.class);
95.108 + }
95.109 + return mappers.allInstances();
95.110 + }
95.111 +}
96.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
96.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/WeakPositions.java Wed Feb 20 15:23:50 2013 +0100
96.3 @@ -0,0 +1,149 @@
96.4 +/*
96.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
96.6 + *
96.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
96.8 + *
96.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
96.10 + * Other names may be trademarks of their respective owners.
96.11 + *
96.12 + * The contents of this file are subject to the terms of either the GNU
96.13 + * General Public License Version 2 only ("GPL") or the Common
96.14 + * Development and Distribution License("CDDL") (collectively, the
96.15 + * "License"). You may not use this file except in compliance with the
96.16 + * License. You can obtain a copy of the License at
96.17 + * http://www.netbeans.org/cddl-gplv2.html
96.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
96.19 + * specific language governing permissions and limitations under the
96.20 + * License. When distributing the software, include this License Header
96.21 + * Notice in each file and include the License file at
96.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
96.23 + * particular file as subject to the "Classpath" exception as provided
96.24 + * by Oracle in the GPL Version 2 section of the License file that
96.25 + * accompanied this code. If applicable, add the following below the
96.26 + * License Header, with the fields enclosed by brackets [] replaced by
96.27 + * your own identifying information:
96.28 + * "Portions Copyrighted [year] [name of copyright owner]"
96.29 + *
96.30 + * Contributor(s):
96.31 + *
96.32 + * The Original Software is NetBeans. The Initial Developer of the Original
96.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
96.34 + * Microsystems, Inc. All Rights Reserved.
96.35 + *
96.36 + * If you wish your version of this file to be governed by only the CDDL
96.37 + * or only the GPL Version 2, indicate your decision by adding
96.38 + * "[Contributor] elects to include this software in this distribution
96.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
96.40 + * single choice of license, a recipient has the option to distribute
96.41 + * your version of this file under either the CDDL, the GPL Version 2 or
96.42 + * to extend the choice of license to its licensees as provided above.
96.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
96.44 + * Version 2 license, then the option applies only if the new code is
96.45 + * made subject to such option by the copyright holder.
96.46 + */
96.47 +
96.48 +package org.netbeans.modules.editor.lib2;
96.49 +
96.50 +import java.util.Map;
96.51 +import java.util.WeakHashMap;
96.52 +import javax.swing.event.DocumentEvent;
96.53 +import javax.swing.event.DocumentListener;
96.54 +import javax.swing.text.BadLocationException;
96.55 +import javax.swing.text.Document;
96.56 +import javax.swing.text.Position;
96.57 +import org.netbeans.modules.editor.lib2.highlighting.OffsetGapList;
96.58 +import org.openide.util.WeakListeners;
96.59 +
96.60 +/**
96.61 + *
96.62 + * @author Vita Stejskal
96.63 + */
96.64 +public final class WeakPositions {
96.65 +
96.66 + /**
96.67 + * Gets a <code>Position</code> in the document at the given offset. The
96.68 + * position is automatically updated when the document's contents is modified.
96.69 + * The <code>Position</code> does not reference the document in anyway that
96.70 + * would prevent the document from being garbage collected.
96.71 + *
96.72 + * @param doc The document to get a position in.
96.73 + * @param offset The initial offset of the position.
96.74 + *
96.75 + * @return A <code>Position</code> inside the document.
96.76 + * @throws BadLocationException If the offset is not valid for the document.
96.77 + */
96.78 + public static Position get(Document doc, int offset) throws BadLocationException {
96.79 + // Check that the offset is valid. This should excercise any rule imposed by
96.80 + // the document on its positions.
96.81 + doc.createPosition(offset);
96.82 +
96.83 + synchronized (OGLS) {
96.84 + OffsetGapList<WeakP> ogl = OGLS.get(doc);
96.85 +
96.86 + if (ogl == null) {
96.87 + ogl = new OffsetGapList<WeakPositions.WeakP>();
96.88 + OGLS.put(doc, ogl);
96.89 + doc.addDocumentListener(WeakListeners.document(documentsTracker, doc));
96.90 + }
96.91 +
96.92 + int index = ogl.findElementIndex(offset);
96.93 + WeakP pos = index >= 0 ? ogl.get(index) : null;
96.94 +
96.95 + if (pos == null) {
96.96 + pos = new WeakP(offset);
96.97 + ogl.add(pos);
96.98 + }
96.99 +
96.100 + return pos;
96.101 + }
96.102 + }
96.103 +
96.104 + // ----------------------------------------------
96.105 + // Private implementation
96.106 + // ----------------------------------------------
96.107 +
96.108 + private static final Map<Document,OffsetGapList<WeakP>> OGLS = new WeakHashMap<Document,OffsetGapList<WeakP>>();
96.109 +
96.110 + private static final DocumentListener documentsTracker = new DocumentListener() {
96.111 +
96.112 + @Override
96.113 + public void insertUpdate(DocumentEvent e) {
96.114 + synchronized (OGLS) {
96.115 + OffsetGapList<WeakPositions.WeakP> ogl = getOgl(e);
96.116 + if (ogl != null) {
96.117 + ogl.defaultInsertUpdate(e.getOffset(), e.getLength());
96.118 + }
96.119 + }
96.120 + }
96.121 +
96.122 + @Override
96.123 + public void removeUpdate(DocumentEvent e) {
96.124 + synchronized (OGLS) {
96.125 + OffsetGapList<WeakPositions.WeakP> ogl = getOgl(e);
96.126 + if (ogl != null) {
96.127 + ogl.defaultRemoveUpdate(e.getOffset(), e.getLength());
96.128 + }
96.129 + }
96.130 + }
96.131 +
96.132 + @Override
96.133 + public void changedUpdate(DocumentEvent e) {
96.134 + // attribute's changed, ignore
96.135 + }
96.136 +
96.137 + private OffsetGapList<WeakPositions.WeakP> getOgl(DocumentEvent e) {
96.138 + Document doc = e.getDocument();
96.139 + return OGLS.get(doc);
96.140 + }
96.141 + };
96.142 +
96.143 + private WeakPositions() {
96.144 +
96.145 + }
96.146 +
96.147 + private static final class WeakP extends OffsetGapList.Offset implements Position {
96.148 + public WeakP(int offset) {
96.149 + super(offset);
96.150 + }
96.151 + } // End of WeakP class
96.152 +}
97.1 --- a/editor.lib2/src/org/netbeans/modules/editor/lib2/document/EditorDocumentContent.java Tue Feb 19 16:39:13 2013 +0100
97.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/document/EditorDocumentContent.java Wed Feb 20 15:23:50 2013 +0100
97.3 @@ -79,6 +79,12 @@
97.4 * <li> createPosition(1): pos1 is returned. </li>
97.5 * <li> Undo (which means Insert(1,2)) returns pos1 to offset==2 (someone might expect offset==3). </li>
97.6 * </ul>
97.7 + *
97.8 + * <br/>
97.9 + * Content intentionally does not reference a document instance to which it belongs
97.10 + * and the EditorPosition should also not reference document instance.
97.11 + * Therefore one may create position and hold it strongly and wait for document instance
97.12 + * to be released (and then e.g. release the position).
97.13 *
97.14 * @author Miloslav Metelka
97.15 * @since 1.46
98.1 --- a/editor.lib2/src/org/netbeans/modules/editor/lib2/document/EditorPosition.java Tue Feb 19 16:39:13 2013 +0100
98.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/document/EditorPosition.java Wed Feb 20 15:23:50 2013 +0100
98.3 @@ -51,6 +51,8 @@
98.4 * <br/>
98.5 * Each position has its corresponding mark which holds a weak reference to it
98.6 * and there's queue that notifies mark vector once the position can be GCed.
98.7 + * <br/>
98.8 + * Position object does not reference document directly (see EditorDocumentContent javadoc).
98.9 *
98.10 * @author Miloslav Metelka
98.11 * @since 1.46
98.12 @@ -81,7 +83,7 @@
98.13 return mark;
98.14 }
98.15
98.16 - void setMark(Mark mark) {
98.17 + void initMark(Mark mark) { // Should only be called once from Mark's constructor
98.18 this.mark = mark;
98.19 }
98.20
99.1 --- a/editor.lib2/src/org/netbeans/modules/editor/lib2/document/Mark.java Tue Feb 19 16:39:13 2013 +0100
99.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/document/Mark.java Wed Feb 20 15:23:50 2013 +0100
99.3 @@ -84,7 +84,7 @@
99.4 super(pos, org.openide.util.Utilities.activeReferenceQueue()); // The queue calls run() when unreachable
99.5 this.markVector = markVector;
99.6 this.rawOffset = rawOffset;
99.7 - pos.setMark(this);
99.8 + pos.initMark(this);
99.9 }
99.10
99.11 public int getOffset() {
100.1 --- a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java Tue Feb 19 16:39:13 2013 +0100
100.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java Wed Feb 20 15:23:50 2013 +0100
100.3 @@ -108,7 +108,8 @@
100.4 private static final Logger LOG = Logger.getLogger(DocumentViewOp.class.getName());
100.5
100.6 static final char PRINTING_SPACE = '\u00B7';
100.7 - static final char PRINTING_TAB = '\u00BB'; // \u21FE
100.8 + static final char PRINTING_TAB = '\u2192';
100.9 + static final char PRINTING_TAB_ALTERNATE = '\u00BB';
100.10 static final char PRINTING_NEWLINE = '\u00B6';
100.11 static final char LINE_CONTINUATION = '\u21A9';
100.12 static final char LINE_CONTINUATION_ALTERNATE = '\u2190';
100.13 @@ -1126,14 +1127,16 @@
100.14
100.15 TextLayout getTabCharTextLayout(double availableWidth) {
100.16 if (tabTextLayout == null) {
100.17 - tabTextLayout = createTextLayout(String.valueOf(PRINTING_TAB), defaultFont);
100.18 + char tabChar = defaultFont.canDisplay(PRINTING_TAB) ? PRINTING_TAB : PRINTING_TAB_ALTERNATE;
100.19 + tabTextLayout = createTextLayout(String.valueOf(tabChar), defaultFont);
100.20 }
100.21 TextLayout ret = tabTextLayout;
100.22 if (tabTextLayout != null && availableWidth > 0 && tabTextLayout.getAdvance() > availableWidth) {
100.23 if (singleCharTabTextLayout == null) {
100.24 for (int i = defaultFont.getSize() - 1; i >= 0; i--) {
100.25 Font font = new Font(defaultFont.getName(), defaultFont.getStyle(), i);
100.26 - singleCharTabTextLayout = createTextLayout(String.valueOf(PRINTING_TAB), font);
100.27 + char tabChar = font.canDisplay(PRINTING_TAB) ? PRINTING_TAB : PRINTING_TAB_ALTERNATE;
100.28 + singleCharTabTextLayout = createTextLayout(String.valueOf(tabChar), font);
100.29 if (singleCharTabTextLayout != null) {
100.30 if (singleCharTabTextLayout.getAdvance() <= getDefaultCharWidth()) {
100.31 LOG.log(Level.FINE, "singleChar font size={0}\n", i);
101.1 --- a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/HighlightsViewUtils.java Tue Feb 19 16:39:13 2013 +0100
101.2 +++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/HighlightsViewUtils.java Wed Feb 20 15:23:50 2013 +0100
101.3 @@ -288,6 +288,8 @@
101.4 renderEndOffset = hiEndOffset;
101.5 AttributeSet attrs = highlights.getAttributes();
101.6 Shape renderPartAlloc;
101.7 + // For nonPrinting TABs display use a special text-layout rectangle
101.8 + Rectangle2D specialTextLayoutRect = null;
101.9 if (textLayout != null) {
101.10 TextHitInfo startHit = TextHitInfo.leading(hiStartOffset - textLayoutOffset);
101.11 TextHitInfo endHit = TextHitInfo.leading(renderEndOffset - textLayoutOffset);
101.12 @@ -320,6 +322,8 @@
101.13 Rectangle2D rEnd = ViewUtils.shapeAsRect(renderEndAlloc);
101.14 r.width = rEnd.getX() - r.x;
101.15 renderPartAlloc = r;
101.16 + specialTextLayoutRect = r;
101.17 +
101.18 if (showNonPrintingChars) {
101.19 renderTextLayout = docView.op.getTabCharTextLayout(r.width);
101.20 } else {
101.21 @@ -371,7 +375,10 @@
101.22
101.23 } else { // Aggregation not done => regular painting
101.24 if (renderTextLayout != null) {
101.25 - paintTextLayout(g, textLayoutRect, renderTextLayout, docView);
101.26 + Rectangle2D tlRect = (specialTextLayoutRect != null)
101.27 + ? specialTextLayoutRect
101.28 + : textLayoutRect;
101.29 + paintTextLayout(g, tlRect, renderTextLayout, docView);
101.30 }
101.31 }
101.32 }
102.1 --- a/editor.search/nbproject/project.properties Tue Feb 19 16:39:13 2013 +0100
102.2 +++ b/editor.search/nbproject/project.properties Wed Feb 20 15:23:50 2013 +0100
102.3 @@ -1,3 +1,3 @@
102.4 javac.source=1.6
102.5 javac.compilerargs=-Xlint -Xlint:-serial
102.6 -spec.version.base=1.12.0
102.7 +spec.version.base=1.13.0
103.1 --- a/editor.search/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
103.2 +++ b/editor.search/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
103.3 @@ -37,7 +37,7 @@
103.4 <compile-dependency/>
103.5 <run-dependency>
103.6 <release-version>3</release-version>
103.7 - <implementation-version/>
103.8 + <specification-version>3.36</specification-version>
103.9 </run-dependency>
103.10 </dependency>
103.11 <dependency>
104.1 --- a/editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java Tue Feb 19 16:39:13 2013 +0100
104.2 +++ b/editor.search/src/org/netbeans/modules/editor/search/EditorFindSupport.java Wed Feb 20 15:23:50 2013 +0100
104.3 @@ -69,7 +69,7 @@
104.4 import org.netbeans.api.editor.mimelookup.MimePath;
104.5 import org.netbeans.api.editor.settings.FontColorNames;
104.6 import org.netbeans.api.editor.settings.SimpleValueNames;
104.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
104.8 +import org.netbeans.api.editor.NavigationHistory;
104.9 import org.netbeans.modules.editor.lib2.ComponentUtils;
104.10 import org.netbeans.modules.editor.lib2.DocUtils;
104.11 import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
105.1 --- a/editor.structure/manifest.mf Tue Feb 19 16:39:13 2013 +0100
105.2 +++ b/editor.structure/manifest.mf Wed Feb 20 15:23:50 2013 +0100
105.3 @@ -3,3 +3,4 @@
105.4 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/structure/Bundle.properties
105.5 OpenIDE-Module-Implementation-Version: 1
105.6 AutoUpdate-Show-In-Client: false
105.7 +OpenIDE-Module-Deprecated: true
106.1 --- a/editor.structure/nbproject/project.properties Tue Feb 19 16:39:13 2013 +0100
106.2 +++ b/editor.structure/nbproject/project.properties Wed Feb 20 15:23:50 2013 +0100
106.3 @@ -51,7 +51,7 @@
106.4
106.5 javac.source=1.6
106.6
106.7 -spec.version.base=1.37.0
106.8 +spec.version.base=1.38.0
106.9
106.10 javadoc.arch=${basedir}/arch.xml
106.11
107.1 --- a/editor.structure/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
107.2 +++ b/editor.structure/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
107.3 @@ -158,8 +158,6 @@
107.4 </test-type>
107.5 </test-dependencies>
107.6 <friend-packages>
107.7 - <friend>org.netbeans.modules.javafx2.editor</friend>
107.8 - <friend>org.netbeans.modules.languages.php</friend>
107.9 <friend>org.netbeans.modules.mobility.svgcore</friend>
107.10 <friend>org.netbeans.modules.xml.text</friend>
107.11 <package>org.netbeans.modules.editor.structure.api</package>
108.1 --- a/editor/src/org/netbeans/modules/editor/impl/NbURLMapper.java Tue Feb 19 16:39:13 2013 +0100
108.2 +++ b/editor/src/org/netbeans/modules/editor/impl/NbURLMapper.java Wed Feb 20 15:23:50 2013 +0100
108.3 @@ -50,7 +50,7 @@
108.4 import java.util.logging.Logger;
108.5 import javax.swing.JEditorPane;
108.6 import javax.swing.text.JTextComponent;
108.7 -import org.netbeans.modules.editor.lib.URLMapper;
108.8 +import org.netbeans.modules.editor.lib2.URLMapper;
108.9 import org.openide.cookies.EditorCookie;
108.10 import org.openide.filesystems.FileObject;
108.11 import org.openide.filesystems.FileStateInvalidException;
108.12 @@ -62,7 +62,7 @@
108.13 *
108.14 * @author Vita Stejskal
108.15 */
108.16 -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.editor.lib.URLMapper.class)
108.17 +@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.editor.lib2.URLMapper.class)
108.18 public final class NbURLMapper extends URLMapper {
108.19
108.20 private static final Logger LOG = Logger.getLogger(NbURLMapper.class.getName());
109.1 --- a/editor/src/org/netbeans/modules/editor/impl/actions/NavigationHistoryBackAction.java Tue Feb 19 16:39:13 2013 +0100
109.2 +++ b/editor/src/org/netbeans/modules/editor/impl/actions/NavigationHistoryBackAction.java Wed Feb 20 15:23:50 2013 +0100
109.3 @@ -65,7 +65,7 @@
109.4 import javax.swing.text.TextAction;
109.5 import org.netbeans.editor.BaseDocument;
109.6 import org.netbeans.editor.BaseKit;
109.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
109.8 +import org.netbeans.api.editor.NavigationHistory;
109.9 import org.openide.awt.DropDownButtonFactory;
109.10 import org.openide.cookies.EditorCookie;
109.11 import org.openide.cookies.LineCookie;
110.1 --- a/editor/src/org/netbeans/modules/editor/impl/actions/NavigationHistoryForwardAction.java Tue Feb 19 16:39:13 2013 +0100
110.2 +++ b/editor/src/org/netbeans/modules/editor/impl/actions/NavigationHistoryForwardAction.java Wed Feb 20 15:23:50 2013 +0100
110.3 @@ -57,7 +57,7 @@
110.4 import javax.swing.text.JTextComponent;
110.5 import javax.swing.text.TextAction;
110.6 import org.netbeans.editor.BaseKit;
110.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
110.8 +import org.netbeans.api.editor.NavigationHistory;
110.9 import org.openide.awt.DropDownButtonFactory;
110.10 import org.openide.util.ContextAwareAction;
110.11 import org.openide.util.ImageUtilities;
111.1 --- a/editor/src/org/netbeans/modules/editor/impl/actions/NavigationHistoryLastEditAction.java Tue Feb 19 16:39:13 2013 +0100
111.2 +++ b/editor/src/org/netbeans/modules/editor/impl/actions/NavigationHistoryLastEditAction.java Wed Feb 20 15:23:50 2013 +0100
111.3 @@ -52,7 +52,7 @@
111.4 import org.netbeans.api.editor.EditorActionRegistration;
111.5 import org.netbeans.editor.BaseAction;
111.6 import org.netbeans.modules.editor.MainMenuAction;
111.7 -import org.netbeans.modules.editor.lib.NavigationHistory;
111.8 +import org.netbeans.api.editor.NavigationHistory;
111.9 import org.openide.util.NbBundle;
111.10 import org.openide.util.WeakListeners;
111.11
112.1 --- a/groovy.editor/test/qa-functional/src/org/netbeans/test/groovy/GeneralGroovy.java Tue Feb 19 16:39:13 2013 +0100
112.2 +++ b/groovy.editor/test/qa-functional/src/org/netbeans/test/groovy/GeneralGroovy.java Wed Feb 20 15:23:50 2013 +0100
112.3 @@ -49,6 +49,7 @@
112.4 import javax.swing.text.BadLocationException;
112.5 import org.netbeans.jellytools.*;
112.6 import org.netbeans.jellytools.modules.editor.CompletionJListOperator;
112.7 +import org.netbeans.jellytools.nodes.Node;
112.8 import org.netbeans.jellytools.nodes.ProjectRootNode;
112.9 import org.netbeans.jemmy.EventTool;
112.10 import org.netbeans.jemmy.JemmyException;
112.11 @@ -68,6 +69,8 @@
112.12 static final String JAVA_PROJECT_NAME = "Java Application";
112.13 static protected final int COMPLETION_LIST_THRESHOLD = 5000;
112.14 protected static final String GROOVY_EXTENSION = ".groovy";
112.15 + protected static final String SAMPLES = "Samples";
112.16 + protected static final String SAMPLES_CATEGORY = "Groovy";
112.17 protected EventTool evt;
112.18
112.19 public GeneralGroovy(String arg0) {
112.20 @@ -240,6 +243,12 @@
112.21 new EditorOperator(sName);
112.22 }
112.23
112.24 + /**
112.25 + * Creates a new Groovy file
112.26 + * @param sProject name of project
112.27 + * @param sItem type of file ("Groovy Class" etc.)
112.28 + * @param sName name of file
112.29 + */
112.30 protected void createGroovyFile(String sProject, String sItem, String sName) {
112.31 createGroovyFile(sProject, sItem, sName, null);
112.32 }
112.33 @@ -348,6 +357,49 @@
112.34 checkCompletionItems(jlist.listItself, asIdeal);
112.35 }
112.36
112.37 + /**
112.38 + * Creates new sample project
112.39 + *
112.40 + * @param sampleName name of sample
112.41 + * @param projectName target project name
112.42 + */
112.43 + public void createSampleProject(String sampleName, String projectName) {
112.44 +
112.45 + NewProjectWizardOperator opNewProjectWizard = NewProjectWizardOperator.invoke();
112.46 + opNewProjectWizard.selectCategory(SAMPLES + "|" + SAMPLES_CATEGORY);
112.47 + opNewProjectWizard.selectProject(sampleName);
112.48 + opNewProjectWizard.next();
112.49 +
112.50 + JDialogOperator jdNew = new JDialogOperator("New");
112.51 + JTextComponentOperator jtName = new JTextComponentOperator(jdNew, sampleName.replaceAll(" ", "").replaceAll("-", ""));
112.52 + jtName.setText(projectName);
112.53 + opNewProjectWizard.finish();
112.54 + waitScanFinished();
112.55 + }
112.56 +
112.57 + /**
112.58 + * Opens file in editor
112.59 + *
112.60 + * @param pathAndFileName relative path to Site Root in Projects window,
112.61 + * e.g. for Site Root/web/index.html it would be "web|index.html" (| is path
112.62 + * separator)
112.63 + * @param projectName project name
112.64 + */
112.65 + public void openFile(String pathAndFileName, String projectName) {
112.66 + if (projectName == null) {
112.67 + throw new IllegalStateException("YOU MUST OPEN PROJECT FIRST");
112.68 + }
112.69 +
112.70 + Node rootNode = new ProjectsTabOperator().getProjectRootNode(projectName);
112.71 + Node node = new Node(rootNode, "Source Packages|" + pathAndFileName);
112.72 + evt.waitNoEvent(1000);
112.73 +
112.74 + if (node.isLeaf()) {
112.75 + node.select();
112.76 + node.performPopupAction("Open");
112.77 + }
112.78 + }
112.79 +
112.80 public class CFulltextStringComparator implements Operator.StringComparator {
112.81
112.82 public boolean equals(java.lang.String caption, java.lang.String match) {
113.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
113.2 +++ b/groovy.editor/test/qa-functional/src/org/netbeans/test/groovy/refactor/testRefactor.java Wed Feb 20 15:23:50 2013 +0100
113.3 @@ -0,0 +1,145 @@
113.4 +/*
113.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
113.6 + *
113.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
113.8 + *
113.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
113.10 + * Other names may be trademarks of their respective owners.
113.11 + *
113.12 + * The contents of this file are subject to the terms of either the GNU
113.13 + * General Public License Version 2 only ("GPL") or the Common
113.14 + * Development and Distribution License("CDDL") (collectively, the
113.15 + * "License"). You may not use this file except in compliance with the
113.16 + * License. You can obtain a copy of the License at
113.17 + * http://www.netbeans.org/cddl-gplv2.html
113.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
113.19 + * specific language governing permissions and limitations under the
113.20 + * License. When distributing the software, include this License Header
113.21 + * Notice in each file and include the License file at
113.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
113.23 + * particular file as subject to the "Classpath" exception as provided
113.24 + * by Oracle in the GPL Version 2 section of the License file that
113.25 + * accompanied this code. If applicable, add the following below the
113.26 + * License Header, with the fields enclosed by brackets [] replaced by
113.27 + * your own identifying information:
113.28 + * "Portions Copyrighted [year] [name of copyright owner]"
113.29 + *
113.30 + * If you wish your version of this file to be governed by only the CDDL
113.31 + * or only the GPL Version 2, indicate your decision by adding
113.32 + * "[Contributor] elects to include this software in this distribution
113.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
113.34 + * single choice of license, a recipient has the option to distribute
113.35 + * your version of this file under either the CDDL, the GPL Version 2 or
113.36 + * to extend the choice of license to its licensees as provided above.
113.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
113.38 + * Version 2 license, then the option applies only if the new code is
113.39 + * made subject to such option by the copyright holder.
113.40 + *
113.41 + * Contributor(s):
113.42 + *
113.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
113.44 + */
113.45 +package org.netbeans.test.groovy.refactor;
113.46 +
113.47 +import java.awt.event.KeyEvent;
113.48 +import javax.swing.KeyStroke;
113.49 +import org.netbeans.test.groovy.GeneralGroovy;
113.50 +import org.netbeans.junit.NbModuleSuite;
113.51 +import junit.framework.Test;
113.52 +import org.netbeans.jellytools.EditorOperator;
113.53 +import org.netbeans.jemmy.operators.JDialogOperator;
113.54 +
113.55 +/**
113.56 + *
113.57 + * @author Vladimir Riha
113.58 + */
113.59 +public class testRefactor extends GeneralGroovy {
113.60 +
113.61 + static final String TEST_BASE_NAME = "groovyref_";
113.62 + static int name_iterator = 0;
113.63 +
113.64 + public testRefactor(String args) {
113.65 + super(args);
113.66 + }
113.67 +
113.68 + public static Test suite() {
113.69 + return NbModuleSuite.create(
113.70 + NbModuleSuite.createConfiguration(testRefactor.class).addTest(
113.71 + "testInstantRefactor",
113.72 + "testRefactor").enableModules(".*").clusters(".*"));
113.73 + }
113.74 +
113.75 + public void testInstantRefactor() {
113.76 + startTest();
113.77 + createSampleProject("NB Project Generators", testRefactor.TEST_BASE_NAME + testRefactor.name_iterator);
113.78 + openFile("generators|NetBeansModule.groovy", testRefactor.TEST_BASE_NAME + testRefactor.name_iterator);
113.79 + waitScanFinished();
113.80 + EditorOperator ep = new EditorOperator("NetBeansModule.groovy");
113.81 + ep.setCaretPosition(7, 7);
113.82 + evt.waitNoEvent(2000);
113.83 + new org.netbeans.jellytools.actions.Action(null, null, KeyStroke.getKeyStroke(KeyEvent.VK_R, 2)).performShortcut(ep);
113.84 + type(ep, "packg");
113.85 + ep.pressKey(KeyEvent.VK_ENTER);
113.86 + assertTrue("file not refactored - contains old value: \n" + ep.getText(), !ep.getText().contains("pkgs"));
113.87 + assertTrue("file not refactored - does not contain new value: \n" + ep.getText(), ep.getText().contains("packg"));
113.88 + testRefactor.name_iterator++;
113.89 + endTest();
113.90 + }
113.91 +
113.92 + public void testRefactor() {
113.93 + startTest();
113.94 + createJavaApplication(testRefactor.TEST_BASE_NAME + testRefactor.name_iterator);
113.95 + createGroovyFile(testRefactor.TEST_BASE_NAME + testRefactor.name_iterator, "Groovy Class", "Foo");
113.96 +
113.97 + EditorOperator ep = new EditorOperator("Foo.groovy");
113.98 + ep.setCaretPosition("{", false);
113.99 + type(ep, "\n def id\n String test(){\n return this.id");
113.100 + ep.save();
113.101 +
113.102 + createGroovyFile(testRefactor.TEST_BASE_NAME + testRefactor.name_iterator, "Groovy Class", "Bar");
113.103 + ep = new EditorOperator("Bar.groovy");
113.104 + ep.setCaretPosition("{", false);
113.105 + type(ep, "\n def id\n String test(){\n def d = new Foo() \n d.id \n return this.id");
113.106 + ep.save();
113.107 +
113.108 + ep.setCaretPosition("d.id", false);
113.109 + ep.pressKey(KeyEvent.VK_LEFT);
113.110 + evt.waitNoEvent(2000);
113.111 + new org.netbeans.jellytools.actions.Action(null, null, KeyStroke.getKeyStroke(KeyEvent.VK_R, 2)).performShortcut(ep);
113.112 + JDialogOperator jo = new JDialogOperator("Rename");
113.113 + jo.typeKey('e');
113.114 + jo.pressKey(KeyEvent.VK_ENTER);
113.115 + new org.netbeans.jellytools.actions.Action(null, null, KeyStroke.getKeyStroke(KeyEvent.VK_R, 8)).performShortcut(ep);
113.116 +
113.117 + ep.pressKey(KeyEvent.VK_ENTER);
113.118 + ep = new EditorOperator("Bar.groovy");
113.119 + String t = ep.getText();
113.120 + assertTrue("file not refactored - contains old value: \n" + t, t.contains("d.e"));
113.121 + assertTrue("file not refactored - contains old value: \n" + t, t.contains("def e"));
113.122 + assertTrue("file not refactored - contains old value: \n" + t, t.contains("this.e"));
113.123 +
113.124 + ep = new EditorOperator("Foo.groovy");
113.125 + t = ep.getText();
113.126 + assertTrue("file not refactored - contains old value: \n" + t, t.contains("def e"));
113.127 + assertTrue("file not refactored - contains old value: \n" + t, t.contains("this.e"));
113.128 + testRefactor.name_iterator++;
113.129 + endTest();
113.130 + }
113.131 +
113.132 + public void testMarkOccurrences() {
113.133 + // depends on 226318
113.134 + startTest();
113.135 + EditorOperator ep = new EditorOperator("NetBeansModule.groovy");
113.136 + ep.setCaretPosition(6, 8);
113.137 + evt.waitNoEvent(100);
113.138 + int[] lines = new int[]{9, 13, 24, 25, 40, 50, 89, 6};
113.139 + int iterator = 0;
113.140 + while (iterator < lines.length && ep.getLineNumber() == lines[iterator]) {
113.141 + iterator++;
113.142 + }
113.143 +
113.144 + ep.pressKey(KeyEvent.VK_ENTER);
113.145 + assertTrue("Not all occurrences has been found: \n" + iterator, iterator == lines.length);
113.146 + endTest();
113.147 + }
113.148 +}
114.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
114.2 +++ b/ide.ergonomics/extide.properties Wed Feb 20 15:23:50 2013 +0100
114.3 @@ -0,0 +1,41 @@
114.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
114.5 +#
114.6 +# Copyright 2010 Oracle and/or its affiliates. All rights reserved.
114.7 +#
114.8 +# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
114.9 +# Other names may be trademarks of their respective owners.
114.10 +#
114.11 +# The contents of this file are subject to the terms of either the GNU
114.12 +# General Public License Version 2 only ("GPL") or the Common
114.13 +# Development and Distribution License("CDDL") (collectively, the
114.14 +# "License"). You may not use this file except in compliance with the
114.15 +# License. You can obtain a copy of the License at
114.16 +# http://www.netbeans.org/cddl-gplv2.html
114.17 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
114.18 +# specific language governing permissions and limitations under the
114.19 +# License. When distributing the software, include this License Header
114.20 +# Notice in each file and include the License file at
114.21 +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
114.22 +# particular file as subject to the "Classpath" exception as provided
114.23 +# by Oracle in the GPL Version 2 section of the License file that
114.24 +# accompanied this code. If applicable, add the following below the
114.25 +# License Header, with the fields enclosed by brackets [] replaced by
114.26 +# your own identifying information:
114.27 +# "Portions Copyrighted [year] [name of copyright owner]"
114.28 +#
114.29 +# If you wish your version of this file to be governed by only the CDDL
114.30 +# or only the GPL Version 2, indicate your decision by adding
114.31 +# "[Contributor] elects to include this software in this distribution
114.32 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
114.33 +# single choice of license, a recipient has the option to distribute
114.34 +# your version of this file under either the CDDL, the GPL Version 2 or
114.35 +# to extend the choice of license to its licensees as provided above.
114.36 +# However, if you add GPL Version 2 code and therefore, elected the GPL
114.37 +# Version 2 license, then the option applies only if the new code is
114.38 +# made subject to such option by the copyright holder.
114.39 +#
114.40 +# Contributor(s):
114.41 +#
114.42 +# Portions Copyrighted 2008 Sun Microsystems, Inc.
114.43 +
114.44 +mainModule=org.apache.tools.ant.module
115.1 --- a/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/AllClustersProcessedCheck.java Tue Feb 19 16:39:13 2013 +0100
115.2 +++ b/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/AllClustersProcessedCheck.java Wed Feb 20 15:23:50 2013 +0100
115.3 @@ -76,6 +76,9 @@
115.4 if (n.equals("ide")) {
115.5 continue;
115.6 }
115.7 + if (n.equals("extide")) {
115.8 + continue;
115.9 + }
115.10 if (n.equals("ergonomics")) {
115.11 continue;
115.12 }
116.1 --- a/ide/launcher/netbeans.clusters Tue Feb 19 16:39:13 2013 +0100
116.2 +++ b/ide/launcher/netbeans.clusters Wed Feb 20 15:23:50 2013 +0100
116.3 @@ -6,6 +6,7 @@
116.4 ergonomics
116.5 # and now the rest
116.6 ide
116.7 +extide
116.8 java
116.9 apisupport
116.10 webcommon
117.1 --- a/j2ee.dd.webservice/nbproject/project.properties Tue Feb 19 16:39:13 2013 +0100
117.2 +++ b/j2ee.dd.webservice/nbproject/project.properties Wed Feb 20 15:23:50 2013 +0100
117.3 @@ -53,3 +53,5 @@
117.4 ${nb_all}/j2ee.dd/external/javaee-api-5.jar:\
117.5 ${websvc.jaxws21api.dir}/modules/ext/jaxws21/api/jsr181-api.jar
117.6 test.config.stableBTD.includes=**/*Test.class
117.7 +
117.8 +requires.nb.javac=true
118.1 --- a/java.hints/src/org/netbeans/modules/java/hints/bugs/NPECheck.java Tue Feb 19 16:39:13 2013 +0100
118.2 +++ b/java.hints/src/org/netbeans/modules/java/hints/bugs/NPECheck.java Wed Feb 20 15:23:50 2013 +0100
118.3 @@ -826,7 +826,11 @@
118.4
118.5 scan(ct, null);
118.6
118.7 - mergeIntoVariable2State(variable2StateBeforeCatch);
118.8 + if (Utilities.exitsFromAllBranchers(info, new TreePath(getCurrentPath(), ct))) {
118.9 + variable2State = variable2StateBeforeCatch;
118.10 + } else {
118.11 + mergeIntoVariable2State(variable2StateBeforeCatch);
118.12 + }
118.13 }
118.14
118.15 if (node.getFinallyBlock() != null) {
119.1 --- a/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/NPECheckTest.java Tue Feb 19 16:39:13 2013 +0100
119.2 +++ b/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/NPECheckTest.java Wed Feb 20 15:23:50 2013 +0100
119.3 @@ -1015,6 +1015,27 @@
119.4 .assertWarnings();
119.5 }
119.6
119.7 + public void testTry226184() throws Exception {
119.8 + HintTest.create()
119.9 + .input("package test;\n" +
119.10 + "class Test {\n" +
119.11 + " private String str() throws Exception {\n" +
119.12 + " return \"\";\n" +
119.13 + " }\n" +
119.14 + " public int process() {\n" +
119.15 + " String builder = null;\n" +
119.16 + " try {\n" +
119.17 + " builder = str();\n" +
119.18 + " } catch (Exception ex) {\n" +
119.19 + " return 0;\n" +
119.20 + " }\n" +
119.21 + " return builder.length();\n" +
119.22 + " }\n" +
119.23 + "}")
119.24 + .run(NPECheck.class)
119.25 + .assertWarnings();
119.26 + }
119.27 +
119.28 public void testFields1() throws Exception {
119.29 HintTest.create()
119.30 .input("package test;\n" +
120.1 --- a/java.source/src/org/netbeans/modules/java/source/usages/BinaryAnalyser.java Tue Feb 19 16:39:13 2013 +0100
120.2 +++ b/java.source/src/org/netbeans/modules/java/source/usages/BinaryAnalyser.java Wed Feb 20 15:23:50 2013 +0100
120.3 @@ -107,6 +107,7 @@
120.4 import org.netbeans.modules.java.source.parsing.FileObjects;
120.5 import org.netbeans.modules.parsing.impl.indexing.SPIAccessor;
120.6 import org.netbeans.modules.parsing.impl.indexing.SuspendSupport;
120.7 +import org.netbeans.modules.parsing.lucene.support.Convertor;
120.8 import org.netbeans.modules.parsing.lucene.support.LowMemoryWatcher;
120.9 import org.netbeans.modules.parsing.spi.indexing.Context;
120.10 import org.openide.filesystems.FileObject;
120.11 @@ -165,6 +166,9 @@
120.12
120.13 private static final String INIT ="<init>"; //NOI18N
120.14 private static final String CLINIT ="<clinit>"; //NOI18N
120.15 + private static final String OUTHER_THIS_PREFIX = "this$"; //NOI18N
120.16 + private static final String ACCESS_METHOD_PREFIX = "access$"; //NOI18N
120.17 + private static final String ASSERTIONS_DISABLED = "$assertionsDisabled"; //NOI18N
120.18 private static final String ROOT = "/"; //NOI18N
120.19 private static final String TIME_STAMPS = "timestamps.properties"; //NOI18N
120.20 private static final String CRC = "crc.properties"; //NOI18N
120.21 @@ -450,10 +454,7 @@
120.22 }
120.23 return new Changes(true, added, removed, changed, preBuildArgs);
120.24 }
120.25 -
120.26 - private static String nameToString( ClassName name ) {
120.27 - return name.getInternalName().replace('/', '.'); // NOI18N
120.28 - }
120.29 +
120.30
120.31 private void releaseData() {
120.32 refs.clear();
120.33 @@ -503,15 +504,9 @@
120.34 @NonNull final Pair<String,String> name,
120.35 @NonNull final UsagesData<ClassName> usages) {
120.36 assert name != null;
120.37 - assert usages != null;
120.38 - final List<String> typeUsages = new ArrayList<String>();
120.39 - for (Map.Entry<ClassName,Set<ClassIndexImpl.UsageType>> entry : usages.usages.entrySet()) {
120.40 - final ClassName cn = entry.getKey();
120.41 - final Set<ClassIndexImpl.UsageType> usage = entry.getValue();
120.42 - typeUsages.add (DocumentUtil.encodeUsage(nameToString(cn), usage));
120.43 - }
120.44 + assert usages != null;
120.45 final Object[] cr = new Object[] {
120.46 - typeUsages,
120.47 + usages.usagesToStrings(),
120.48 usages.featureIdentsToString(),
120.49 usages.identsToString()
120.50 };
120.51 @@ -534,15 +529,23 @@
120.52 //<editor-fold defaultstate="collapsed" desc="ClassFileProcessor implementations">
120.53 private static class ClassFileProcessor {
120.54
120.55 + private static final Convertor<ClassName,String> CONVERTOR =
120.56 + new Convertor<ClassName, String>() {
120.57 + @Override
120.58 + public String convert(ClassName p) {
120.59 + return p.getInternalName().replace('/', '.'); // NOI18N
120.60 + }
120.61 + };
120.62 +
120.63 private final ClassFile classFile;
120.64 private final String className;
120.65 private final UsagesData<ClassName> usages =
120.66 - new UsagesData<ClassName>();
120.67 + new UsagesData<ClassName>(CONVERTOR);
120.68
120.69 ClassFileProcessor(
120.70 @NonNull final ClassFile classFile) {
120.71 this.classFile = classFile;
120.72 - this.className = nameToString (classFile.getName ());
120.73 + this.className = CONVERTOR.convert(classFile.getName ());
120.74 }
120.75
120.76 final String getClassName() {
120.77 @@ -572,7 +575,7 @@
120.78
120.79 final void addIdent (@NonNull final CharSequence ident) {
120.80 assert ident != null;
120.81 - usages.featuresIdents.add(ident);
120.82 + usages.addFeatureIdent(ident);
120.83 }
120.84
120.85 final void addUsage (
120.86 @@ -581,16 +584,11 @@
120.87 if (OBJECT.equals(name.getExternalName())) {
120.88 return;
120.89 }
120.90 - Set<ClassIndexImpl.UsageType> uset = usages.usages.get(name);
120.91 - if (uset == null) {
120.92 - uset = EnumSet.noneOf(ClassIndexImpl.UsageType.class);
120.93 - usages.usages.put(name, uset);
120.94 - }
120.95 - uset.add(usage);
120.96 + usages.addUsage(name, usage);
120.97 }
120.98
120.99 final boolean hasUsage(@NonNull final ClassName name) {
120.100 - return usages.usages.keySet().contains (name);
120.101 + return usages.hasUsage(name);
120.102 }
120.103
120.104 final void handleAnnotations(
120.105 @@ -682,23 +680,40 @@
120.106 @Override
120.107 void visit(@NonNull final Method m) {
120.108 final String name = m.getName();
120.109 - if (!m.isSynthetic() && !isInit(name)) {
120.110 + if (!m.isSynthetic() &&
120.111 + !isInit(name) &&
120.112 + !isAccessorMethod(name)) {
120.113 addIdent(name);
120.114 }
120.115 super.visit(m);
120.116 }
120.117
120.118 @Override
120.119 - void visit(@NonNull final Variable v) {
120.120 - if (!v.isSynthetic()) {
120.121 - addIdent(v.getName());
120.122 + void visit(@NonNull final Variable v) {
120.123 + final String name = v.getName();
120.124 + if (!v.isSynthetic() &&
120.125 + !isOutherThis(name) &&
120.126 + !isDisableAssertions(name)) {
120.127 + addIdent(name);
120.128 }
120.129 super.visit(v);
120.130 }
120.131
120.132 - private boolean isInit(@NonNull final String name) {
120.133 + private static boolean isInit(@NonNull final String name) {
120.134 return INIT.equals(name) || CLINIT.equals(name);
120.135 }
120.136 +
120.137 + private static boolean isOutherThis(@NonNull final String name) {
120.138 + return name.startsWith(OUTHER_THIS_PREFIX);
120.139 + }
120.140 +
120.141 + private static boolean isAccessorMethod(@NonNull final String name) {
120.142 + return name.startsWith(ACCESS_METHOD_PREFIX);
120.143 + }
120.144 +
120.145 + private static boolean isDisableAssertions(@NonNull final String name) {
120.146 + return ASSERTIONS_DISABLED.equals(name);
120.147 + }
120.148 }
120.149
120.150 private static final class FullIndexProcessor extends ClassSignatureProcessor {
121.1 --- a/java.source/src/org/netbeans/modules/java/source/usages/SourceAnalyzerFactory.java Tue Feb 19 16:39:13 2013 +0100
121.2 +++ b/java.source/src/org/netbeans/modules/java/source/usages/SourceAnalyzerFactory.java Wed Feb 20 15:23:50 2013 +0100
121.3 @@ -80,6 +80,7 @@
121.4 import org.netbeans.modules.java.source.indexing.JavaCustomIndexer;
121.5 import org.netbeans.modules.java.source.parsing.FileObjects;
121.6 import org.netbeans.modules.java.source.parsing.OutputFileManager;
121.7 +import org.netbeans.modules.parsing.lucene.support.Convertor;
121.8 import org.openide.filesystems.FileObject;
121.9 import org.openide.filesystems.FileUtil;
121.10 import org.openide.filesystems.URLMapper;
121.11 @@ -280,13 +281,8 @@
121.12 protected final void addClassReferences (final Pair<String,String> name, final UsagesData<String> data) {
121.13 assert name != null;
121.14 assert data != null;
121.15 - final Object[] result = new Object[3];
121.16 - final Map<String,Set<ClassIndexImpl.UsageType>> usages = data.usages;
121.17 - final List<String> ru = new LinkedList<String>();
121.18 - for (Map.Entry<String,Set<ClassIndexImpl.UsageType>> ue : usages.entrySet()) {
121.19 - ru.add (DocumentUtil.encodeUsage(ue.getKey(),ue.getValue()));
121.20 - }
121.21 - result[0] = ru;
121.22 + final Object[] result = new Object[3];
121.23 + result[0] = data.usagesToStrings();
121.24 result[1] = data.featureIdentsToString();
121.25 result[2] = data.identsToString();
121.26 this.references.add(Pair.<Pair<String,String>,Object[]>of(name,result));
121.27 @@ -297,6 +293,14 @@
121.28
121.29 enum State {EXTENDS, IMPLEMENTS, GT, OTHER, IMPORT, PACKAGE_ANN};
121.30
121.31 + private static final Convertor<String,String> CONVERTOR =
121.32 + new Convertor<String, String>() {
121.33 + @Override
121.34 + public String convert(String p) {
121.35 + return p;
121.36 + }
121.37 + };
121.38 +
121.39 private final Stack<Pair<String,String>> activeClass;
121.40 private final Name errorName;
121.41 private final Name pkgImportName;
121.42 @@ -784,7 +788,7 @@
121.43 addUsage(s, nameOfCU, data, ClassIndexImpl.UsageType.TYPE_REFERENCE);
121.44 }
121.45 for (Symbol s : staticImports) {
121.46 - addUsage(
121.47 + addUsages(
121.48 s,
121.49 nameOfCU,
121.50 data,
121.51 @@ -858,12 +862,12 @@
121.52 @NullAllowed final Symbol sym,
121.53 @NonNull final Pair<String,String>owner,
121.54 @NonNull final Map<Pair<String,String>, UsagesData<String>> map,
121.55 - @NonNull final ClassIndexImpl.UsageType... types) {
121.56 + @NonNull final ClassIndexImpl.UsageType type) {
121.57 assert map != null;
121.58 - assert types != null;
121.59 + assert type != null;
121.60 if (sym != null) {
121.61 final String className = encodeClassName(sym);
121.62 - addUsage(className, owner, map, types);
121.63 + addUsage(className, owner, map, type);
121.64 final Symbol encElm = sym.getEnclosingElement();
121.65 if (encElm.getKind() == ElementKind.PACKAGE) {
121.66 unusedPkgImports.remove(encElm);
121.67 @@ -875,17 +879,38 @@
121.68 @NullAllowed final String className,
121.69 @NonNull final Pair<String,String>owner,
121.70 @NonNull final Map<Pair<String,String>, UsagesData<String>> map,
121.71 + @NonNull final ClassIndexImpl.UsageType type) {
121.72 + if (className != null) {
121.73 + final UsagesData<String> data = getData(owner, map);
121.74 + data.addUsage(className, type);
121.75 + }
121.76 + }
121.77 +
121.78 + private void addUsages (
121.79 + @NullAllowed final Symbol sym,
121.80 + @NonNull final Pair<String,String>owner,
121.81 + @NonNull final Map<Pair<String,String>, UsagesData<String>> map,
121.82 + @NonNull final ClassIndexImpl.UsageType... types) {
121.83 + assert map != null;
121.84 + assert types != null;
121.85 + if (sym != null) {
121.86 + final String className = encodeClassName(sym);
121.87 + addUsages(className, owner, map, types);
121.88 + final Symbol encElm = sym.getEnclosingElement();
121.89 + if (encElm.getKind() == ElementKind.PACKAGE) {
121.90 + unusedPkgImports.remove(encElm);
121.91 + }
121.92 + }
121.93 + }
121.94 +
121.95 + private void addUsages(
121.96 + @NullAllowed final String className,
121.97 + @NonNull final Pair<String,String>owner,
121.98 + @NonNull final Map<Pair<String,String>, UsagesData<String>> map,
121.99 @NonNull final ClassIndexImpl.UsageType... types) {
121.100 if (className != null) {
121.101 final UsagesData<String> data = getData(owner, map);
121.102 - Set<ClassIndexImpl.UsageType> usageType = data.usages.get (className);
121.103 - if (usageType == null) {
121.104 - usageType = EnumSet.noneOf(ClassIndexImpl.UsageType.class);
121.105 - data.usages.put (className, usageType);
121.106 - }
121.107 - for (ClassIndexImpl.UsageType type : types) {
121.108 - usageType.add (type);
121.109 - }
121.110 + data.addUsages(className,types);
121.111 }
121.112 }
121.113
121.114 @@ -900,10 +925,10 @@
121.115 if (feature || fullIndex) {
121.116 final UsagesData<String> data = getData(owner, map);
121.117 if (fullIndex) {
121.118 - data.idents.add(ident);
121.119 + data.addIdent(ident);
121.120 }
121.121 if (feature) {
121.122 - data.featuresIdents.add(ident);
121.123 + data.addFeatureIdent(ident);
121.124 }
121.125 }
121.126 }
121.127 @@ -915,7 +940,7 @@
121.128 if (owner.first.charAt(owner.first.length()-2) == '.') { //NOI18N
121.129 throw new IllegalArgumentException(owner.first);
121.130 }
121.131 - data = new UsagesData<String> ();
121.132 + data = new UsagesData<String> (CONVERTOR);
121.133 map.put(owner,data);
121.134 }
121.135 return data;
122.1 --- a/java.source/src/org/netbeans/modules/java/source/usages/UsagesData.java Tue Feb 19 16:39:13 2013 +0100
122.2 +++ b/java.source/src/org/netbeans/modules/java/source/usages/UsagesData.java Wed Feb 20 15:23:50 2013 +0100
122.3 @@ -41,20 +41,70 @@
122.4 */
122.5 package org.netbeans.modules.java.source.usages;
122.6
122.7 +import java.util.ArrayList;
122.8 +import java.util.EnumSet;
122.9 import java.util.HashMap;
122.10 import java.util.HashSet;
122.11 +import java.util.List;
122.12 import java.util.Map;
122.13 import java.util.Set;
122.14 import org.netbeans.api.annotations.common.NonNull;
122.15 +import org.netbeans.modules.parsing.lucene.support.Convertor;
122.16 +import org.openide.util.Parameters;
122.17
122.18 /**
122.19 *
122.20 * @author Tomas Zezula
122.21 */
122.22 final class UsagesData<T> {
122.23 - final Map<T, Set<ClassIndexImpl.UsageType>> usages = new HashMap<T, Set<ClassIndexImpl.UsageType>>();
122.24 - final Set<CharSequence> featuresIdents = new HashSet<CharSequence>();
122.25 - final Set<CharSequence> idents = new HashSet<CharSequence>();
122.26 +
122.27 + private final Convertor<? super T, String> convertor;
122.28 + private final Map<T, Set<ClassIndexImpl.UsageType>> usages = new HashMap<T, Set<ClassIndexImpl.UsageType>>();
122.29 + private final Set<CharSequence> featuresIdents = new HashSet<CharSequence>();
122.30 + private final Set<CharSequence> idents = new HashSet<CharSequence>();
122.31 +
122.32 +
122.33 + UsagesData(@NonNull final Convertor<? super T, String> convertor) {
122.34 + Parameters.notNull("convertor", convertor); //NOI18N
122.35 + this.convertor = convertor;
122.36 + }
122.37 +
122.38 + void addFeatureIdent(@NonNull final CharSequence ident) {
122.39 + featuresIdents.add(ident);
122.40 + }
122.41 +
122.42 + void addIdent(@NonNull final CharSequence ident) {
122.43 + idents.add(ident);
122.44 + }
122.45 +
122.46 + void addUsage(
122.47 + @NonNull final T className,
122.48 + @NonNull final ClassIndexImpl.UsageType type) {
122.49 + Set<ClassIndexImpl.UsageType> usageType = usages.get (className);
122.50 + if (usageType == null) {
122.51 + usageType = EnumSet.of(type);
122.52 + usages.put (className, usageType);
122.53 + } else {
122.54 + usageType.add (type);
122.55 + }
122.56 + }
122.57 +
122.58 + void addUsages(
122.59 + @NonNull final T className,
122.60 + @NonNull final ClassIndexImpl.UsageType... types) {
122.61 + Set<ClassIndexImpl.UsageType> usageType = usages.get (className);
122.62 + if (usageType == null) {
122.63 + usageType = EnumSet.noneOf(ClassIndexImpl.UsageType.class);
122.64 + usages.put (className, usageType);
122.65 + }
122.66 + for (ClassIndexImpl.UsageType type : types) {
122.67 + usageType.add (type);
122.68 + }
122.69 + }
122.70 +
122.71 + boolean hasUsage(@NonNull final T name) {
122.72 + return usages.containsKey(name);
122.73 + }
122.74
122.75 String featureIdentsToString() {
122.76 return toString(featuresIdents);
122.77 @@ -64,6 +114,17 @@
122.78 return toString(idents);
122.79 }
122.80
122.81 + List<String> usagesToStrings() {
122.82 + final List<String> result = new ArrayList<String>();
122.83 + for (Map.Entry<T,Set<ClassIndexImpl.UsageType>> entry : usages.entrySet()) {
122.84 + result.add (
122.85 + DocumentUtil.encodeUsage(
122.86 + convertor.convert(entry.getKey()),
122.87 + entry.getValue()));
122.88 + }
122.89 + return result;
122.90 + }
122.91 +
122.92 private String toString(@NonNull final Set<? extends CharSequence> data) {
122.93 final StringBuilder sb = new StringBuilder();
122.94 for (CharSequence id : data) {
123.1 --- a/javafx2.editor/nbproject/project.xml Tue Feb 19 16:39:13 2013 +0100
123.2 +++ b/javafx2.editor/nbproject/project.xml Wed Feb 20 15:23:50 2013 +0100
123.3 @@ -104,15 +104,6 @@
123.4 </run-dependency>
123.5 </dependency>
123.6 <dependency>
123.7 - <code-name-base>org.netbeans.modules.editor.structure</code-name-base>
123.8 - <build-prerequisite/>
123.9 - <compile-dependency/>
123.10 - <run-dependency>
123.11 - <release-version>1</release-version>
123.12 - <specification-version>1.31</specification-version>
123.13 - </run-dependency>
123.14 - </dependency>
123.15 - <dependency>
123.16 <code-name-base>org.netbeans.modules.java.editor</code-name-base>
123.17 <build-prerequisite/>
123.18 <compile-dependency/>
124.1 --- a/libs.javacimpl/external/binaries-list Tue Feb 19 16:39:13 2013 +0100
124.2 +++ b/libs.javacimpl/external/binaries-list Wed Feb 20 15:23:50 2013 +0100
124.3 @@ -1,1 +1,1 @@
124.4 -BEB71DAECCEE6298488B66EA3BADDC26FBC818AE nb-javac-impl.jar
124.5 +FB97404EF3DE0AC221ABE6102C13FB95A291DBBF nb-javac-impl.jar
125.1 --- a/nbbuild/build.properties Tue Feb 19 16:39:13 2013 +0100
125.2 +++ b/nbbuild/build.properties Wed Feb 20 15:23:50 2013 +0100
125.3 @@ -232,4 +232,5 @@
125.4 config.jnlp.stable=\
125.5 ${nb.cluster.platform},\
125.6 ${nb.cluster.ide},\
125.7 + ${nb.cluster.extide},\
125.8 ${nb.cluster.java}
126.1 --- a/nbbuild/cluster.properties Tue Feb 19 16:39:13 2013 +0100
126.2 +++ b/nbbuild/cluster.properties Wed Feb 20 15:23:50 2013 +0100
126.3 @@ -71,6 +71,7 @@
126.4 clusters.config.php.list=\
126.5 ${clusters.config.platform.list},\
126.6 nb.cluster.ide,\
126.7 + nb.cluster.extide,\
126.8 nb.cluster.webcommon,\
126.9 nb.cluster.php,\
126.10 nb.cluster.websvccommon,\
126.11 @@ -97,6 +98,7 @@
126.12 clusters.config.java.list=\
126.13 ${clusters.config.platform.list},\
126.14 nb.cluster.ide,\
126.15 + nb.cluster.extide,\
126.16 nb.cluster.websvccommon,\
126.17 nb.cluster.java,\
126.18 nb.cluster.javafx,\
126.19 @@ -446,6 +448,7 @@
126.20 nb.cluster.java.dir=java
126.21 nb.cluster.java.depends=\
126.22 nb.cluster.ide,\
126.23 + nb.cluster.extide,\
126.24 nb.cluster.platform,\
126.25 nb.cluster.websvccommon,\
126.26 nb.cluster.harness
126.27 @@ -543,9 +546,7 @@
126.28 maven.repository,\
126.29 maven.search,\
126.30 maven.spring,\
126.31 - o.apache.tools.ant.module,\
126.32 o.jdesktop.beansbinding,\
126.33 - options.java,\
126.34 projectimport.eclipse.core,\
126.35 projectimport.eclipse.j2se,\
126.36 refactoring.java,\
126.37 @@ -569,6 +570,7 @@
126.38 nb.cluster.apisupport.depends=\
126.39 nb.cluster.java,\
126.40 nb.cluster.ide,\
126.41 + nb.cluster.extide,\
126.42 nb.cluster.platform,\
126.43 nb.cluster.harness
126.44 nb.cluster.apisupport=\
126.45 @@ -590,6 +592,7 @@
126.46 nb.cluster.enterprise.depends=\
126.47 nb.cluster.java,\
126.48 nb.cluster.ide,\
126.49 + nb.cluster.extide,\
126.50 nb.cluster.profiler,\
126.51 nb.cluster.webcommon,\
126.52 nb.cluster.websvccommon,\
126.53 @@ -740,6 +743,7 @@
126.54 nb.cluster.profiler.depends=\
126.55 nb.cluster.ide,\
126.56 nb.cluster.java,\
126.57 + nb.cluster.extide,\
126.58 nb.cluster.platform
126.59 nb.cluster.profiler=\
126.60 debugger.jpda.heapwalk,\
126.61 @@ -776,6 +780,7 @@
126.62 nb.cluster.php.depends=\
126.63 nb.cluster.platform,\
126.64 nb.cluster.ide,\
126.65 + nb.cluster.extide,\
126.66 nb.cluster.webcommon,\
126.67 nb.cluster.websvccommon
126.68 nb.cluster.php=\
126.69 @@ -814,6 +819,7 @@
126.70 nb.cluster.groovy.depends=\
126.71 nb.cluster.platform,\
126.72 nb.cluster.ide,\
126.73 + nb.cluster.extide,\
126.74 nb.cluster.java
126.75 nb.cluster.groovy=\
126.76 groovy.antproject,\
126.77 @@ -834,7 +840,8 @@
126.78 nb.cluster.websvccommon,\
126.79 nb.cluster.apisupport,\
126.80 nb.cluster.ide,\
126.81 - nb.cluster.enterprise
126.82 + nb.cluster.enterprise,\
126.83 + nb.cluster.extide
126.84 nb.cluster.mobility=\
126.85 api.mobility,\
126.86 deployment.deviceanywhere,\
126.87 @@ -882,7 +889,8 @@
126.88 nb.cluster.platform,\
126.89 nb.cluster.java,\
126.90 nb.cluster.ide,\
126.91 - nb.cluster.enterprise
126.92 + nb.cluster.enterprise,\
126.93 + nb.cluster.extide
126.94 nb.cluster.identity=\
126.95 identity.ant,\
126.96 identity.kit,\
126.97 @@ -1147,10 +1155,6 @@
126.98 contrib/tanui,\
126.99 contrib/websvc.saas.services.rtm,\
126.100 contrib/whichproject,\
126.101 - cordova,\
126.102 - cordova.platforms,\
126.103 - cordova.platforms.android,\
126.104 - cordova.platforms.ios,\
126.105 j2ee.websphere6,\
126.106 j2me.cdc.platform.bdj,\
126.107 j2me.cdc.project.bdj,\
126.108 @@ -1171,6 +1175,15 @@
126.109 websvc.jaxrpc16,\
126.110 websvc.jaxrpckit,\
126.111 websvc.registry
126.112 +
126.113 +nb.cluster.extide.dir=extide
126.114 +nb.cluster.extide.depends=\
126.115 + nb.cluster.ide,\
126.116 + nb.cluster.platform
126.117 +nb.cluster.extide=\
126.118 + o.apache.tools.ant.module,\
126.119 + options.java
126.120 +
126.121 # XXX needs updates to build:
126.122 # contrib/c.s.fortress,\
126.123 # contrib/fortress.editing,\
126.124 @@ -1178,8 +1191,13 @@
126.125 nb.cluster.webcommon.dir=webcommon
126.126 nb.cluster.webcommon.depends=\
126.127 nb.cluster.ide,\
126.128 + nb.cluster.extide,\
126.129 nb.cluster.platform
126.130 nb.cluster.webcommon=\
126.131 + cordova,\
126.132 + cordova.platforms,\
126.133 + cordova.platforms.android,\
126.134 + cordova.platforms.ios,\
126.135 javascript.jstestdriver,\
126.136 languages.apacheconf,\
126.137 languages.ini,\
126.138 @@ -1217,6 +1235,7 @@
126.139 nb.cluster.javacard.dir=javacard
126.140 nb.cluster.javacard.depends=\
126.141 nb.cluster.ide,\
126.142 + nb.cluster.extide,\
126.143 nb.cluster.platform,\
126.144 nb.cluster.java
126.145 nb.cluster.javacard=\
126.146 @@ -1239,6 +1258,7 @@
126.147 nb.cluster.javafx.dir=javafx
126.148 nb.cluster.javafx.depends=\
126.149 nb.cluster.ide,\
126.150 + nb.cluster.extide,\
126.151 nb.cluster.platform,\
126.152 nb.cluster.java,\
126.153 nb.cluster.websvccommon,\
127.1 --- a/o.apache.tools.ant.module/manifest.mf Tue Feb 19 16:39:13 2013 +0100
127.2 +++ b/o.apache.tools.ant.module/manifest.mf Wed Feb 20 15:23:50 2013 +0100
127.3 @@ -3,4 +3,4 @@
127.4 OpenIDE-Module-Implementation-Version: 2
127.5 OpenIDE-Module-Localizing-Bundle: org/apache/tools/ant/module/Bundle.properties
127.6 OpenIDE-Module-Layer: org/apache/tools/ant/module/resources/AntModuleLayer.xml
127.7 -AutoUpdate-Show-In-Client: false
127.8 +AutoUpdate-Show-In-Client: true
128.1 --- a/o.apache.tools.ant.module/nbproject/project.properties Tue Feb 19 16:39:13 2013 +0100
128.2 +++ b/o.apache.tools.ant.module/nbproject/project.properties Wed Feb 20 15:23:50 2013 +0100
128.3 @@ -42,7 +42,7 @@
128.4
128.5 javac.compilerargs=-Xlint:unchecked
128.6 javac.source=1.6
128.7 -spec.version.base=3.62.0
128.8 +spec.version.base=3.63.0
128.9 compile.ant.jar=${ant.core.lib}
128.10 src-bridge.cp.extra=build/classes:${compile.ant.jar}
128.11 extra.module.files=\
129.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
129.2 +++ b/o.apache.tools.ant.module/release/VERSION.txt Wed Feb 20 15:23:50 2013 +0100
129.3 @@ -0,0 +1,2 @@
129.4 +# cluster incompatible release version
129.5 +1
130.1 --- a/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateModulesTest.java Tue Feb 19 16:39:13 2013 +0100
130.2 +++ b/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateModulesTest.java Wed Feb 20 15:23:50 2013 +0100
130.3 @@ -92,10 +92,10 @@
130.4 suite.addTest(NbModuleSuite.createConfiguration(ValidateModulesTest.class).
130.5 clusters(".*").enableModules(".*").honorAutoloadEager(true).gui(false).enableClasspathModules(false).suite());
130.6 suite.addTest(NbModuleSuite.createConfiguration(ValidateModulesTest.class).
130.7 - clusters("platform|harness|ide|websvccommon|java|profiler|nb").enableModules(".*").
130.8 + clusters("platform|harness|ide|websvccommon|java|profiler|nb|extide").enableModules(".*").
130.9 honorAutoloadEager(true).gui(false).enableClasspathModules(false).suite());
130.10 suite.addTest(NbModuleSuite.createConfiguration(ValidateModulesTest.class).
130.11 - clusters("platform|harness|ide").enableModules(".*").honorAutoloadEager(true).gui(false).enableClasspathModules(false).suite());
130.12 + clusters("platform|harness|ide|extide").enableModules(".*").honorAutoloadEager(true).gui(false).enableClasspathModules(false).suite());
130.13 return suite;
130.14 }
130.15
130.16 @@ -204,7 +204,7 @@
130.17 if ("true".equals(m.getAttribute("OpenIDE-Module-Deprecated"))) {
130.18 String cnb = m.getCodeNameBase();
130.19 if (cnb.equals("org.jdesktop.layout") || cnb.equals("org.netbeans.modules.editor.deprecated.pre65formatting") ||
130.20 - cnb.equals("org.netbeans.modules.java.hints.legacy.spi")) {
130.21 + cnb.equals("org.netbeans.modules.java.hints.legacy.spi") || cnb.equals("org.netbeans.modules.editor.structure")) {
130.22 // Will take a while to fix, don't report as error now.
130.23 continue;
130.24 }
131.1 --- a/options.editor/apichanges.xml Tue Feb 19 16:39:13 2013 +0100
131.2 +++ b/options.editor/apichanges.xml Wed Feb 20 15:23:50 2013 +0100
131.3 @@ -110,6 +110,33 @@
131.4 <!-- ACTUAL CHANGES BEGIN HERE: -->
131.5
131.6 <changes>
131.7 + <change id="AddedHiglightingPanelController">
131.8 + <summary>Separating HighlightingPanel and its controller</summary>
131.9 + <version major="1" minor="39"/>
131.10 + <date day="19" month="2" year="2012"/>
131.11 + <author login="mkristofic"/>
131.12 + <compatibility source="incompatible" binary="compatible" deletion="yes" addition="yes" modification="yes"/>
131.13 + <description>
131.14 + <p>
131.15 + [sigtest] Missing Superclasses or Superinterfaces
131.16 + [sigtest] ---------------------------------------
131.17 + [sigtest]
131.18 + [sigtest] org.netbeans.modules.options.colors.HighlightingPanel: interface @ org.netbeans.modules.options.colors.spi.FontsColorsController
131.19 + [sigtest]
131.20 + [sigtest] Missing Methods
131.21 + [sigtest] ---------------
131.22 + [sigtest]
131.23 + [sigtest] org.netbeans.modules.options.colors.HighlightingPanel: method public javax.swing.JComponent org.netbeans.modules.options.colors.HighlightingPanel.getComponent()
131.24 + [sigtest]
131.25 + [sigtest] Added Classes
131.26 + [sigtest] -------------
131.27 + [sigtest]
131.28 + [sigtest] org.netbeans.modules.options.colors.HighlightingPanelController
131.29 + </p>
131.30 + </description>
131.31 + <class package="org.netbeans.modules.options.colors" name="HighlightingPanelController"/>
131.32 + <issue number="199592"/>
131.33 + </change>
131.34 <change id="FormattingCustomizerPanel.moved">
131.35 <api name="spi"/>
131.36 <summary>Moving FormattingCustomizerPanel to editor.indent.project module</summary>
132.1 --- a/options.editor/manifest.mf Tue Feb 19 16:39:13 2013 +0100
132.2 +++ b/options.editor/manifest.mf Wed Feb 20 15:23:50 2013 +0100
132.3 @@ -2,6 +2,6 @@
132.4 OpenIDE-Module: org.netbeans.modules.options.editor/1
132.5 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties
132.6 OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml
132.7 -OpenIDE-Module-Specification-Version: 1.38
132.8 +OpenIDE-Module-Specification-Version: 1.39
132.9 AutoUpdate-Show-In-Client: false
132.10
133.1 --- a/options.editor/src/org/netbeans/modules/options/colors/HighlightingPanel.java Tue Feb 19 16:39:13 2013 +0100
133.2 +++ b/options.editor/src/org/netbeans/modules/options/colors/HighlightingPanel.java Wed Feb 20 15:23:50 2013 +0100
133.3 @@ -61,7 +61,6 @@
133.4 import java.util.Set;
133.5 import java.util.Vector;
133.6 import javax.swing.AbstractButton;
133.7 -import javax.swing.JComponent;
133.8 import javax.swing.JLabel;
133.9 import javax.swing.JPanel;
133.10 import javax.swing.ListSelectionModel;
133.11 @@ -70,9 +69,6 @@
133.12 import javax.swing.text.AttributeSet;
133.13 import javax.swing.text.SimpleAttributeSet;
133.14 import javax.swing.text.StyleConstants;
133.15 -import org.netbeans.api.options.OptionsDisplayer;
133.16 -import org.netbeans.modules.options.colors.spi.FontsColorsController;
133.17 -import org.netbeans.spi.options.OptionsPanelController;
133.18 import org.openide.awt.ColorComboBox;
133.19 import org.openide.awt.Mnemonics;
133.20 import org.openide.util.NbBundle;
133.21 @@ -81,8 +77,7 @@
133.22 *
133.23 * @author Jan Jancura
133.24 */
133.25 -@OptionsPanelController.Keywords(keywords={"#KW_HighlightPanel"}, location=OptionsDisplayer.FONTSANDCOLORS, tabTitle= "#Editor_tab.displayName")
133.26 -public class HighlightingPanel extends JPanel implements ActionListener, ItemListener, FontsColorsController {
133.27 +public class HighlightingPanel extends JPanel implements ActionListener, ItemListener {
133.28
133.29 private ColorModel colorModel = null;
133.30 private boolean listen = false;
133.31 @@ -218,7 +213,6 @@
133.32 changed = true;
133.33 }
133.34
133.35 - @Override
133.36 public void update (ColorModel colorModel) {
133.37 this.colorModel = colorModel;
133.38 currentProfile = colorModel.getCurrentProfile ();
133.39 @@ -231,14 +225,12 @@
133.40 changed = false;
133.41 }
133.42
133.43 - @Override
133.44 public void cancel () {
133.45 toBeSaved = new HashSet<String>();
133.46 profileToCategories = new HashMap<String, Vector<AttributeSet>>();
133.47 changed = false;
133.48 }
133.49
133.50 - @Override
133.51 public void applyChanges() {
133.52 if (colorModel == null) return;
133.53 for(String profile : toBeSaved) {
133.54 @@ -254,12 +246,10 @@
133.55 profileToCategories = new HashMap<String, Vector<AttributeSet>>();
133.56 }
133.57
133.58 - @Override
133.59 public boolean isChanged () {
133.60 return changed;
133.61 }
133.62
133.63 - @Override
133.64 public void setCurrentProfile (String currentProfile) {
133.65 String oldScheme = this.currentProfile;
133.66 this.currentProfile = currentProfile;
133.67 @@ -274,7 +264,6 @@
133.68 refreshUI ();
133.69 }
133.70
133.71 - @Override
133.72 public void deleteProfile (String profile) {
133.73 if (colorModel.isCustomProfile (profile))
133.74 profileToCategories.remove (profile);
133.75 @@ -284,11 +273,6 @@
133.76 }
133.77 toBeSaved.add (profile);
133.78 }
133.79 -
133.80 - @Override
133.81 - public JComponent getComponent() {
133.82 - return this;
133.83 - }
133.84
133.85 // other methods ...........................................................
133.86
134.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
134.2 +++ b/options.editor/src/org/netbeans/modules/options/colors/HighlightingPanelController.java Wed Feb 20 15:23:50 2013 +0100
134.3 @@ -0,0 +1,100 @@
134.4 +/*
134.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
134.6 + *
134.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
134.8 + *
134.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
134.10 + * Other names may be trademarks of their respective owners.
134.11 + *
134.12 + * The contents of this file are subject to the terms of either the GNU
134.13 + * General Public License Version 2 only ("GPL") or the Common
134.14 + * Development and Distribution License("CDDL") (collectively, the
134.15 + * "License"). You may not use this file except in compliance with the
134.16 + * License. You can obtain a copy of the License at
134.17 + * http://www.netbeans.org/cddl-gplv2.html
134.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
134.19 + * specific language governing permissions and limitations under the
134.20 + * License. When distributing the software, include this License Header
134.21 + * Notice in each file and include the License file at
134.22 + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
134.23 + * particular file as subject to the "Classpath" exception as provided
134.24 + * by Oracle in the GPL Version 2 section of the License file that
134.25 + * accompanied this code. If applicable, add the following below the
134.26 + * License Header, with the fields enclosed by brackets [] replaced by
134.27 + * your own identifying information:
134.28 + * "Portions Copyrighted [year] [name of copyright owner]"
134.29 + *
134.30 + * If you wish your version of this file to be governed by only the CDDL
134.31 + * or only the GPL Version 2, indicate your decision by adding
134.32 + * "[Contributor] elects to include this software in this distribution
134.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
134.34 + * single choice of license, a recipient has the option to distribute
134.35 + * your version of this file under either the CDDL, the GPL Version 2 or
134.36 + * to extend the choice of license to its licensees as provided above.
134.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
134.38 + * Version 2 license, then the option applies only if the new code is
134.39 + * made subject to such option by the copyright holder.
134.40 + *
134.41 + * Contributor(s):
134.42 + *
134.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
134.44 + */
134.45 +package org.netbeans.modules.options.colors;
134.46 +
134.47 +import javax.swing.JComponent;
134.48 +import org.netbeans.api.options.OptionsDisplayer;
134.49 +import org.netbeans.modules.options.colors.spi.FontsColorsController;
134.50 +import org.netbeans.spi.options.OptionsPanelController;
134.51 +
134.52 +/**
134.53 + *
134.54 + * @since 1.39
134.55 + */
134.56 +@OptionsPanelController.Keywords(keywords={"#KW_HighlightPanel"}, location=OptionsDisplayer.FONTSANDCOLORS, tabTitle= "#Editor_tab.displayName")
134.57 +public class HighlightingPanelController implements FontsColorsController{
134.58 +
134.59 + private HighlightingPanel component = null;
134.60 +
134.61 + @Override
134.62 + public void update(ColorModel model) {
134.63 + getHighlightingPanel().update(model);
134.64 + }
134.65 +
134.66 + @Override
134.67 + public void setCurrentProfile(String profile) {
134.68 + getHighlightingPanel().setCurrentProfile(profile);
134.69 + }
134.70 +
134.71 + @Override
134.72 + public void deleteProfile(String profile) {
134.73 + getHighlightingPanel().deleteProfile(profile);
134.74 + }
134.75 +
134.76 + @Override
134.77 + public void applyChanges() {
134.78 + getHighlightingPanel().applyChanges();
134.79 + }
134.80 +
134.81 + @Override
134.82 + public void cancel() {
134.83 + getHighlightingPanel().cancel();
134.84 + }
134.85 +
134.86 + @Override
134.87 + public boolean isChanged() {
134.88 + return getHighlightingPanel().isChanged();
134.89 + }
134.90 +
134.91 + @Override
134.92 + public JComponent getComponent() {
134.93 + return getHighlightingPanel();
134.94 + }
134.95 +
134.96 + private HighlightingPanel getHighlightingPanel() {
134.97 + if (component == null) {
134.98 + component = new HighlightingPanel();
134.99 + }
134.100 + return component;
134.101 + }
134.102 +
134.103 +}
135.1 --- a/options.editor/src/org/netbeans/modules/options/editor/mf-layer.xml Tue Feb 19 16:39:13 2013 +0100
135.2 +++ b/options.editor/src/org/netbeans/modules/options/editor/mf-layer.xml Wed Feb 20 15:23:50 2013 +0100
135.3 @@ -214,7 +214,7 @@
135.4 </file>
135.5 <file name="HighlightingPanel.instance">
135.6 <attr name="instanceOf" stringvalue="org.netbeans.modules.options.colors.spi.FontsColorsController"/>
135.7 - <attr name="instanceCreate" newvalue="org.netbeans.modules.options.colors.HighlightingPanel"/>
135.8 + <attr name="instanceCreate" newvalue="org.netbeans.modules.options.colors.HighlightingPanelController"/>
135.9 <attr name="position" intvalue="200"/>
135.10 </file>
135.11 <file name="AnnotationsPanel.instance">
136.1 --- a/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java Tue Feb 19 16:39:13 2013 +0100
136.2 +++ b/parsing.api/src/org/netbeans/modules/parsing/impl/indexing/RepositoryUpdater.java Wed Feb 20 15:23:50 2013 +0100
136.3 @@ -1137,17 +1137,9 @@
136.4 }
136.5 }
136.6 }
136.7 - }
136.8 -
136.9 - if (jobs.isEmpty()) {
136.10 - // either all documents are up-to-date or we can't find owning source roots,
136.11 - // which may happen right after start when no roots have been scanned yet,
136.12 - // try forcing the initial scan in order to block TaskProcessor (#165170)
136.13 - scheduleWork(null, false);
136.14 - } else {
136.15 - for(FileListWork job : jobs.values()) {
136.16 - scheduleWork(job, false);
136.17 - }
136.18 + }
136.19 + for(FileListWork job : jobs.values()) {
136.20 + scheduleWork(job, false);
136.21 }
136.22 }
136.23
137.1 --- a/php.editor/test/qa-functional/src/org/netbeans/test/php/hints/testHints.java Tue Feb 19 16:39:13 2013 +0100
137.2 +++ b/php.editor/test/qa-functional/src/org/netbeans/test/php/hints/testHints.java Wed Feb 20 15:23:50 2013 +0100
137.3 @@ -66,6 +66,7 @@
137.4 return NbModuleSuite.create(
137.5 NbModuleSuite.createConfiguration(testHints.class).addTest(
137.6 "CreateApplication",
137.7 + "testAmbiguousHint",
137.8 "testImmutableVariable",
137.9 "testImmutableVariableSimple",
137.10 "testUnusedUse",
137.11 @@ -170,6 +171,18 @@
137.12 endTest();
137.13 }
137.14
137.15 + public void testAmbiguousHint() {
137.16 + EditorOperator file = CreatePHPFile(TEST_PHP_NAME, "PHP File", "AmbiguousHint");
137.17 + startTest();
137.18 + file.setCaretPosition("*/", false);
137.19 + new EventTool().waitNoEvent(1000);
137.20 + TypeCode(file, "\n $foo == 1+1;");
137.21 + file.save();
137.22 + new EventTool().waitNoEvent(2000);
137.23 + checkNumberOfAnnotationsContains("Possible accidental ", 1, "Incorrect number of Ambiguous comparison hints", file);
137.24 + endTest();
137.25 + }
137.26 +
137.27 public void testImmutableVariable() {
137.28 EditorOperator file = CreatePHPFile(TEST_PHP_NAME, "PHP File", "Immutable2");
137.29 startTest();
137.30 @@ -196,38 +209,38 @@
137.31 }
137.32
137.33 private void checkNumberOfAnnotationsContains(String annotation, int expectedOccurences, String failMsg, EditorOperator file) {
137.34 -
137.35 +
137.36 final EditorOperator eo = new EditorOperator(file.getName());
137.37 final int limit = expectedOccurences;
137.38 try {
137.39 new Waiter(new Waitable() {
137.40
137.41 - @Override
137.42 - public Object actionProduced(Object oper) {
137.43 - return eo.getAnnotations().length > limit ? Boolean.TRUE : null;
137.44 - }
137.45 + @Override
137.46 + public Object actionProduced(Object oper) {
137.47 + return eo.getAnnotations().length > limit ? Boolean.TRUE : null;
137.48 + }
137.49
137.50 - @Override
137.51 - public String getDescription() {
137.52 - return ("Wait parser annotations."); // NOI18N
137.53 - }
137.54 - }).waitAction(null);
137.55 -
137.56 -
137.57 - int numberOfErrors = 0;
137.58 - int lines = file.getText().split(System.getProperty("line.separator")).length;
137.59 - Object[] ann;
137.60 - int lineCounter = 1;
137.61 - while (lineCounter <= lines) {
137.62 - ann = file.getAnnotations(lineCounter);
137.63 - for (Object o : ann) {
137.64 - if (EditorOperator.getAnnotationShortDescription(o).toString().contains(annotation) && !EditorOperator.getAnnotationShortDescription(o).toString().contains("HTML error checking")) {
137.65 - numberOfErrors++;
137.66 - }
137.67 - }
137.68 - lineCounter++;
137.69 - }
137.70 - assertEquals(failMsg, expectedOccurences, numberOfErrors);
137.71 + @Override
137.72 + public String getDescription() {
137.73 + return ("Wait parser annotations."); // NOI18N
137.74 + }
137.75 + }).waitAction(null);
137.76 +
137.77 +
137.78 + int numberOfErrors = 0;
137.79 + int lines = file.getText().split(System.getProperty("line.separator")).length;
137.80 + Object[] ann;
137.81 + int lineCounter = 1;
137.82 + while (lineCounter <= lines) {
137.83 + ann = file.getAnnotations(lineCounter);
137.84 + for (Object o : ann) {
137.85 + if (EditorOperator.getAnnotationShortDescription(o).toString().contains(annotation) && !EditorOperator.getAnnotationShortDescription(o).toString().contains("HTML error checking")) {
137.86 + numberOfErrors++;
137.87 + }
137.88 + }
137.89 + lineCounter++;
137.90 + }
137.91 + assertEquals(failMsg, expectedOccurences, numberOfErrors);
137.92 } catch (InterruptedException ex) {
137.93 Exceptions.printStackTrace(ex);
137.94 }
138.1 --- a/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java Tue Feb 19 16:39:13 2013 +0100
138.2 +++ b/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java Wed Feb 20 15:23:50 2013 +0100
138.3 @@ -377,11 +377,13 @@
138.4 if(newModifiers != null) {
138.5 checkNewModifier(getCurrentPath(), method);
138.6 }
138.7 + boolean passThrough = false;
138.8 TreePath enclosingMethod = JavaPluginUtils.findMethod(getCurrentPath());
138.9 - Element enclosingElement = workingCopy.getTrees().getElement(enclosingMethod);
138.10 - boolean passThrough = false;
138.11 - if(isMethodMatch(enclosingElement, method)) {
138.12 - passThrough = true;
138.13 + if(enclosingMethod != null) {
138.14 + Element enclosingElement = workingCopy.getTrees().getElement(enclosingMethod);
138.15 + if(isMethodMatch(enclosingElement, method)) {
138.16 + passThrough = true;
138.17 + }
138.18 }
138.19 List<ExpressionTree> arguments = getNewArguments(tree.getArguments(), passThrough, method);
138.20
139.1 --- a/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/InlineTest.java Tue Feb 19 16:39:13 2013 +0100
139.2 +++ b/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/InlineTest.java Wed Feb 20 15:23:50 2013 +0100
139.3 @@ -1238,7 +1238,7 @@
139.4 + "public class A {\n"
139.5 + " private int fact(int n) {\n"
139.6 + " int result;\n"
139.7 - + " if (n == 1) {\n"
139.8 + + " if (n == 1)\n"
139.9 + " result = 1;\n"
139.10 + " else\n"
139.11 + " result = fact(n - 1) * n;\n"
140.1 --- a/team.ui/src/org/netbeans/modules/team/ui/resources/layer.xml Tue Feb 19 16:39:13 2013 +0100
140.2 +++ b/team.ui/src/org/netbeans/modules/team/ui/resources/layer.xml Wed Feb 20 15:23:50 2013 +0100
140.3 @@ -39,11 +39,15 @@
140.4 <attr name="originalFile" stringvalue="Actions/Team/org-netbeans-modules-team-ui-LogoutAction.instance"/>
140.5 <attr name="position" intvalue="110"/>
140.6 </file>
140.7 - <file name="org-netbeans-modules-team-ui-Menu-separatorAfter.instance">
140.8 + <file name="org-netbeans-modules-team-ui-SubMenu-separatorAfter.instance">
140.9 <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
140.10 <attr name="position" intvalue="111"/>
140.11 </file>
140.12 </folder>
140.13 + <file name="org-netbeans-modules-team-ui-Menu-separatorAfter.instance">
140.14 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
140.15 + <attr name="position" intvalue="51"/>
140.16 + </file>
140.17 </folder>
140.18 <folder name="Window">
140.19 <file name="TeamAction.shadow">
141.1 --- a/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/GeneralHTMLProject.java Tue Feb 19 16:39:13 2013 +0100
141.2 +++ b/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/GeneralHTMLProject.java Wed Feb 20 15:23:50 2013 +0100
141.3 @@ -258,7 +258,33 @@
141.4 public void openProject(String projectName) throws IOException {
141.5 JemmyProperties.setCurrentTimeout("ActionProducer.MaxActionTime", 180000);
141.6 openDataProjects(projectName);
141.7 - evt.waitNoEvent(3000);
141.8 + waitScanFinished();
141.9 + }
141.10 +
141.11 + /**
141.12 + * Waits for Remote Files node to appear in Projects tab
141.13 + *
141.14 + * @param projectName
141.15 + */
141.16 + public void waitForRemoteFiles(String projectName) {
141.17 + final String project = projectName;
141.18 + try {
141.19 + Waiter waiter = new Waiter(new Waitable() {
141.20 + @Override
141.21 + public Object actionProduced(Object obj) {
141.22 + Node rootNode = new ProjectsTabOperator().getProjectRootNode(project);
141.23 + return rootNode.isChildPresent("Remote Files") ? Boolean.TRUE : null;
141.24 + }
141.25 +
141.26 + @Override
141.27 + public String getDescription() {
141.28 + return ("Wait for Remote Files node to appear");
141.29 + }
141.30 + });
141.31 +
141.32 + waiter.waitAction(null);
141.33 + } catch (InterruptedException e) {
141.34 + }
141.35 }
141.36
141.37 /**
141.38 @@ -337,6 +363,30 @@
141.39 List<? extends org.openide.nodes.Node> nodes = page.getNodesMatchingSelectedRule();
141.40 return getElements(nodes);
141.41 }
141.42 +
141.43 + /**
141.44 + * Opens given file and types space at the end of first line (on slow system this seems to help with parsing Remote files)
141.45 + * @param pathAndFileName
141.46 + * @param projectName
141.47 + * @param fileName
141.48 + */
141.49 + public void dummyEdit(String pathAndFileName, String projectName, String fileName){
141.50 +
141.51 + Node rootNode = new ProjectsTabOperator().getProjectRootNode(projectName);
141.52 + Node node = new Node(rootNode, "Site Root|" + pathAndFileName);
141.53 + evt.waitNoEvent(500);
141.54 +
141.55 + if (node.isLeaf()) {
141.56 + node.select();
141.57 + node.performPopupAction("Open");
141.58 + }
141.59 +
141.60 + EditorOperator ep = new EditorOperator(fileName);
141.61 + ep.setCaretPositionToEndOfLine(1);
141.62 + type(ep, " ");
141.63 + ep.save();
141.64 + ep.close();
141.65 + }
141.66
141.67 private HTMLElement[] getElements(List<? extends org.openide.nodes.Node> nodes) {
141.68 ArrayList<String> parents;
142.1 --- a/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/debug/LineDebuggerTest.java Tue Feb 19 16:39:13 2013 +0100
142.2 +++ b/web.clientproject/test/qa-functional/src/org/netbeans/test/html5/debug/LineDebuggerTest.java Wed Feb 20 15:23:50 2013 +0100
142.3 @@ -300,6 +300,8 @@
142.4 */
142.5 public void testBreakpointRemoteFile() throws Exception {
142.6 startTest();
142.7 + dummyEdit("debug.html", LineDebuggerTest.current_project, "debug.html"); // workaround for automated tests on slow machines
142.8 + waitForRemoteFiles(LineDebuggerTest.current_project);
142.9 openRemoteFile("common.js", LineDebuggerTest.current_project);
142.10 openFile("debug.html", LineDebuggerTest.current_project);
142.11 runFile(LineDebuggerTest.current_project, "debug.html");
143.1 --- a/web.inspect/src/org/netbeans/modules/web/inspect/files/initialization.js Tue Feb 19 16:39:13 2013 +0100
143.2 +++ b/web.inspect/src/org/netbeans/modules/web/inspect/files/initialization.js Wed Feb 20 15:23:50 2013 +0100
143.3 @@ -254,6 +254,7 @@
143.4 var canvas = document.getElementById(NetBeans.GLASSPANE_ID);
143.5 canvas.style.pointerEvents = value;
143.6 this.lastHighlighted = null;
143.7 + this.selectionMode = selectionMode;
143.8 };
143.9
143.10 // Repaints the glass-pane
143.11 @@ -430,6 +431,28 @@
143.12 ctx.restore();
143.13 };
143.14
143.15 +// Filters/blocks some mouse events when Select/Inspect mode is turned on.
143.16 +// This, for example, allows design/selection of JavaScript-based menus.
143.17 +NetBeans.installMouseEventFilters = function() {
143.18 + var blockingListener = function(e) {
143.19 + if (NetBeans.selectionMode && (e.target.id !== NetBeans.GLASSPANE_ID)) {
143.20 + e.stopImmediatePropagation();
143.21 + e.preventDefault();
143.22 + }
143.23 + };
143.24 + document.documentElement.addEventListener('click', blockingListener, true);
143.25 + document.documentElement.addEventListener('contextmenu', blockingListener, true);
143.26 + document.documentElement.addEventListener('dblclick', blockingListener, true);
143.27 + document.documentElement.addEventListener('mousedown', blockingListener, true);
143.28 + document.documentElement.addEventListener('mouseenter', blockingListener, true);
143.29 + document.documentElement.addEventListener('mouseleave', blockingListener, true);
143.30 + document.documentElement.addEventListener('mousemove', blockingListener, true);
143.31 + document.documentElement.addEventListener('mouseout', blockingListener, true);
143.32 + document.documentElement.addEventListener('mouseover', blockingListener, true);
143.33 + document.documentElement.addEventListener('mouseup', blockingListener, true);
143.34 + document.documentElement.addEventListener('mousewheel', blockingListener, true);
143.35 +};
143.36 +
143.37 NetBeans.setWindowActive = function(active) {
143.38 this.windowActive = active;
143.39 if (!active) {
143.40 @@ -440,4 +463,6 @@
143.41 // Insert glass-pane into the inspected page
143.42 NetBeans.insertGlassPane();
143.43
143.44 +NetBeans.installMouseEventFilters();
143.45 +
143.46 }
144.1 --- a/web.project/src/org/netbeans/modules/web/project/WebProject.java Tue Feb 19 16:39:13 2013 +0100
144.2 +++ b/web.project/src/org/netbeans/modules/web/project/WebProject.java Wed Feb 20 15:23:50 2013 +0100
144.3 @@ -194,6 +194,7 @@
144.4 import org.openide.filesystems.FileLock;
144.5 import org.openide.filesystems.FileSystem.AtomicAction;
144.6 import org.openide.loaders.DataObject;
144.7 +import org.openide.modules.Places;
144.8 import org.openide.util.Exceptions;
144.9 import org.openide.util.NbBundle;
144.10 import org.openide.util.RequestProcessor;
144.11 @@ -1068,7 +1069,8 @@
144.12 private void updateProject() {
144.13 // Make it easier to run headless builds on the same machine at least.
144.14 EditableProperties ep = updateHelper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH);
144.15 - File buildProperties = new File(System.getProperty("netbeans.user"), "build.properties"); // NOI18N
144.16 +
144.17 + File buildProperties = new File(Places.getUserDirectory(), "build.properties"); // NOI18N
144.18 ep.setProperty("user.properties.file", buildProperties.getAbsolutePath()); //NOI18N
144.19
144.20 //remove jaxws.endorsed.dir property