本文整理汇总了Java中org.netbeans.spi.project.support.ant.PropertyUtils.getUsablePropertyName方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyUtils.getUsablePropertyName方法的具体用法?Java PropertyUtils.getUsablePropertyName怎么用?Java PropertyUtils.getUsablePropertyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.project.support.ant.PropertyUtils
的用法示例。
在下文中一共展示了PropertyUtils.getUsablePropertyName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFreeAntName
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
@NonNull
public static String getFreeAntName (@NonNull final String name) {
if (name == null || name.length() == 0) {
throw new IllegalArgumentException ();
}
final FileObject platformsFolder = FileUtil.getConfigFile(PLATFORM_STOREGE);
String antName = PropertyUtils.getUsablePropertyName(name);
if (platformsFolder.getFileObject(antName,"xml") != null) { //NOI18N
String baseName = antName;
int index = 1;
antName = baseName + Integer.toString (index);
while (platformsFolder.getFileObject(antName,"xml") != null) { //NOI18N
index ++;
antName = baseName + Integer.toString (index);
}
}
return antName;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:PlatformConvertor.java示例2: addFileRef
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
private void addFileRef(Map<String, String> props, String path) {
// #66275:
// XXX parts of code copied from o.n.spi.project.ant.ReferenceHelper;
// will do proper API change later with issue #70894, will also simplify impl of isssue #66188
final File normalizedFile = FileUtil.normalizeFile(PropertyUtils.resolveFile(getProjectDirectoryFile(), path));
String fileID = normalizedFile.getName();
// if the file is folder then add to ID string also parent folder name,
// i.e. if external source folder name is "src" the ID will
// be a bit more selfdescribing, e.g. project-src in case
// of ID for ant/project/src directory.
if (normalizedFile.isDirectory() && normalizedFile.getParentFile() != null) {
fileID = normalizedFile.getParentFile().getName()+"-"+normalizedFile.getName();
}
fileID = PropertyUtils.getUsablePropertyName(fileID);
// we don't need to resolve duplicate file names here, all <c-p-e>-s reside in release/modules/ext
props.put(REF_START + fileID, path);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:NbModuleProject.java示例3: getValueTag
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
private static String getValueTag(DotClassPathEntry entry) {
switch (entry.getKind()) {
case PROJECT:
return entry.getRawPath().substring(1); // project name
case VARIABLE:
String v[] = EclipseUtils.splitVariable(entry.getRawPath());
return PropertyUtils.getUsablePropertyName(v[0]) + v[1]; // variable name
case CONTAINER:
return entry.getContainerMapping(); // mapping as produced by container resolver
case LIBRARY:
case OUTPUT:
case SOURCE:
default:
return entry.getRawPath(); // file path
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ProjectFactorySupport.java示例4: getFreeAntName
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
@NonNull
public static String getFreeAntName(@NonNull final String name) {
if (name == null || name.length() == 0) {
throw new IllegalArgumentException();
}
final FileObject platformsFolder = FileUtil.getConfigFile(AndroidSdkProvider.PLATFORM_STORAGE);
String antName = PropertyUtils.getUsablePropertyName(name);
if (platformsFolder.getFileObject(antName, "xml") != null) { //NOI18N
String baseName = antName;
int index = 1;
antName = baseName + Integer.toString(index);
while (platformsFolder.getFileObject(antName, "xml") != null) { //NOI18N
index++;
antName = baseName + Integer.toString(index);
}
}
return antName;
}
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:19,代码来源:PlatformConvertor.java示例5: getName
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
@Override
public String getName() {
synchronized (guard) {
if (name == null) {
name = PropertyUtils.getUsablePropertyName(getDisplayName());
}
return name;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ProjectInfoImpl.java示例6: TestJavaPlatform
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
public TestJavaPlatform(
@NonNull final String name,
@NonNull final FileObject installFolder,
@NonNull final Map<String,String> sysProps) {
super(
name,
PropertyUtils.getUsablePropertyName(name),
Collections.singletonList(installFolder.toURL()),
new HashMap<String, String>(),
sysProps,
Collections.emptyList(),
Collections.emptyList());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:TestJavaPlatform.java示例7: prototype
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
@NonNull
public static RemotePlatform prototype(
@NonNull final String displayName,
@NonNull final Map<String,String> additionalProperties,
@NonNull final Map<String,String> sysProps ) {
Parameters.notNull("displayName", displayName); //NOI18N
Parameters.notNull("additionalProperties", additionalProperties); //NOI18N
Parameters.notNull("sysProps", sysProps); //NOI18N
String currentDisplayName = displayName;
String antName;
for (int i=0;;i++) {
antName = PropertyUtils.getUsablePropertyName(currentDisplayName);
if (RemotePlatformProvider.isValidPlatformAntName(antName)) {
break;
}
currentDisplayName = String.format(
"%s %d", //NOI18N
displayName,
i);
}
final Map<String,String> props = new HashMap<>();
props.putAll(additionalProperties);
props.put(PLAT_PROP_ANT_NAME, antName);
return create(
displayName,
props,
sysProps);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:RemotePlatform.java示例8: asAntVariable
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
/**
* Converts VARIABLE classpath entry to Ant property, eg.
* SOME_ROOT/lib/a.jar -> ${var.SOME_ROOT}/lib/a.jar
*/
private static String asAntVariable(DotClassPathEntry entry) {
if (entry.getKind() != DotClassPathEntry.Kind.VARIABLE) {
throw new IllegalStateException("not a VARIABLE entry "+entry); // NOI18N
}
String s[] = EclipseUtils.splitVariable(entry.getRawPath());
String varName = PropertyUtils.getUsablePropertyName(s[0]);
return "${var."+varName+"}"+s[1]; // NOI18N
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ProjectFactorySupport.java示例9: setupEnvironmentVariables
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
void setupEnvironmentVariables(List<String> importProblems) throws IOException {
if (workspace == null) {
return;
}
EditableProperties ep = PropertyUtils.getGlobalProperties();
boolean changed = false;
for (DotClassPathEntry entry : cp.getClassPathEntries()) {
if (entry.getKind() != DotClassPathEntry.Kind.VARIABLE) {
continue;
}
String s = EclipseUtils.splitVariable(entry.getRawPath())[0];
Workspace.Variable v = getVariable(s);
if (v != null) {
s = "var."+PropertyUtils.getUsablePropertyName(s); //NOI18N
if (ep.getProperty(s) == null) {
ep.setProperty(s, v.getLocation());
changed = true;
} else if (!ep.getProperty(s).equals(v.getLocation())) {
importProblems.add(org.openide.util.NbBundle.getMessage(EclipseProject.class, "MSG_IDEVariableMismatch", s, ep.getProperty(s), v.getLocation())); //NOI18N
}
} else {
importProblems.add(org.openide.util.NbBundle.getMessage(EclipseProject.class, "MSG_IDEVariableNotFound", s)); //NOI18N
ep.setProperty(s, ""); //NOI18N
changed = true;
}
}
if (changed) {
PropertyUtils.putGlobalProperties(ep);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:EclipseProject.java示例10: getName
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
public String getName() {
return PropertyUtils.getUsablePropertyName(getSimpleName());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:SuiteProject.java示例11: getName
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
public String getName() {
return PropertyUtils.getUsablePropertyName(getDisplayName());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:FreeformProject.java示例12: getNetBeansLibraryName
import org.netbeans.spi.project.support.ant.PropertyUtils; //导入方法依赖的package包/类
private static String getNetBeansLibraryName(String container) {
return PropertyUtils.getUsablePropertyName(getEclipseLibraryName(container));
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ClassPathContainerResolver.java本文标签属性:
示例:示例图
代码:代码编程
java:java面试题
PropertyUtils:achieve
getUsablePropertyName:getUsablePropertyName