本文整理汇总了Java中org.openide.util.NbBundle.getBranding方法的典型用法代码示例。如果您正苦于以下问题:Java NbBundle.getBranding方法的具体用法?Java NbBundle.getBranding怎么用?Java NbBundle.getBranding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.NbBundle
的用法示例。
在下文中一共展示了NbBundle.getBranding方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLocalizingSuffixesFast
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Similar to {@link NbBundle#getLocalizingSuffixes} but optimized.
* @since JST-PENDING: Called from InstalledFileLocatorImpl
*/
static synchronized String[] getLocalizingSuffixesFast() {
if (suffixes == null ||
Locale.getDefault() != lastLocale ||
!BaseUtilities.compareObjects(NbBundle.getBranding(), lastBranding)) {
List<String> _suffixes = new ArrayList<String>();
Iterator<String> it = NbBundle.getLocalizingSuffixes();
while (it.hasNext()) {
_suffixes.add(it.next());
}
suffixes = _suffixes.toArray(new String[_suffixes.size()]);
lastLocale = Locale.getDefault();
lastBranding = NbBundle.getBranding();
}
return suffixes;
}
示例2: testBrandingLayerOverrides
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Test #21173/#23595: overriding layers by branding. */
public void testBrandingLayerOverrides() throws Exception {
Main.getModuleSystem ();
final MockEvents ev = new MockEvents();
NbInstaller installer = new NbInstaller(ev);
ModuleManager mgr = new ModuleManager(installer, ev);
installer.registerManager(mgr);
mgr.mutexPrivileged().enterWriteAccess();
try {
String orig = NbBundle.getBranding();
NbBundle.setBranding("foo");
try {
Module m1 = mgr.create(new File(jars, "base-layer-mod.jar"), null, false, false, false);
assertEquals(Collections.EMPTY_SET, m1.getProblems());
mgr.enable(m1);
assertEquals("special contents", slurp("foo/file1.txt"));
assertEquals(null, slurp("foo/file2.txt"));
mgr.disable(m1);
mgr.delete(m1);
} finally {
NbBundle.setBranding(orig);
}
} finally {
mgr.mutexPrivileged().exitWriteAccess();
}
}
示例3: setUp
import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
branding = NbBundle.getBranding();
locale = Locale.getDefault();
clearWorkDir();
install = new File(getWorkDir(), "install");
platform = new File(install, "platform");
ide = createIdeCluster(install);
userdir = new File(getWorkDir(), "tmp");
System.setProperty("netbeans.home", platform.getPath());
System.setProperty("netbeans.dirs", ide.getPath());
System.setProperty("netbeans.user", userdir.getPath());
createModule("org.openide.awt", platform, 50000L);
createModule("org.openide.nodes", platform, 60000L);
createModule("org.netbeans.api.languages", ide, 90000L);
createModule("org.netbeans.modules.logmanagement", userdir, 10000L);
reset();
Thread.sleep(100);
Logger l = Logger.getLogger("org");
l.setLevel(Level.OFF);
l.setUseParentHandlers(false);
}
示例4: setUp
import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
branding = NbBundle.getBranding();
locale = Locale.getDefault();
clearWorkDir();
install = new File(getWorkDir(), "install");
platform = new File(install, "platform");
ide = new File(install, "ide");
userdir = new File(getWorkDir(), "tmp");
System.setProperty("netbeans.home", platform.getPath());
System.setProperty("netbeans.dirs", ide.getPath());
System.setProperty("netbeans.user", userdir.getPath());
createModule("org.openide.awt", platform, 50000L);
createModule("org.openide.nodes", platform, 60000L);
createModule("org.netbeans.api.languages", ide, 90000L);
createModule("org.netbeans.modules.logmanagement", userdir, 10000L);
Thread.sleep(100);
createPopulateZip();
Logger l = Logger.getLogger("org");
l.setLevel(Level.OFF);
l.setUseParentHandlers(false);
}
示例5: setUp
import org.openide.util.NbBundle; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
branding = NbBundle.getBranding();
locale = Locale.getDefault();
clearWorkDir();
install = new File(getWorkDir(), "install");
platform = new File(install, "platform");
ide = new File(install, "ide");
userdir = new File(getWorkDir(), "tmp");
cache = new File(install, "cache");
System.setProperty("netbeans.home", platform.getPath());
System.setProperty("netbeans.dirs", ide.getPath());
System.setProperty("netbeans.user", userdir.getPath());
createModule("org.openide.awt", platform, 50000L);
createModule("org.openide.nodes", platform, 60000L);
createModule("org.netbeans.api.languages", ide, 90000L);
createModule("org.netbeans.modules.logmanagement", userdir, 10000L);
Thread.sleep(100);
createPopulateZip();
Logger l = Logger.getLogger("org");
l.setLevel(Level.OFF);
l.setUseParentHandlers(false);
}
示例6: LocaleIterator
import org.openide.util.NbBundle; //导入方法依赖的package包/类
/** Creates new LocaleIterator for given locale.
* @param locale given Locale
*/
public LocaleIterator(Locale locale) {
this.locale = this.initLocale = locale;
// if (locale.equals(Locale.getDefault())) {
// defaultInProgress = true;
// }
current = '_' + locale.toString();
if (NbBundle.getBranding() == null)
branding = null;
else
branding = "_" + NbBundle.getBranding(); // NOI18N
//System.err.println("Constructed: " + this);
}
示例7: nonNullBranding
import org.openide.util.NbBundle; //导入方法依赖的package包/类
private String nonNullBranding() {
String s = NbBundle.getBranding();
return s == null ? "" : s;
}
示例8: testBrandingIsAssigned
import org.openide.util.NbBundle; //导入方法依赖的package包/类
public void testBrandingIsAssigned() throws Exception {
String branding = NbBundle.getBranding();
assertEquals("Default branding in NetBeans is nb", "nb", branding);
}
示例9: getSystemLocaleValue
import org.openide.util.NbBundle; //导入方法依赖的package包/类
public static String getSystemLocaleValue () {
String branding;
return Locale.getDefault().toString() + ((branding = NbBundle.getBranding()) == null ? "" : (" (" + branding + ")")); // NOI18N
}