本文整理匯總了Java中java.beans.Beans.isDesignTime方法的典型用法代碼示例。如果您正苦於以下問題:Java Beans.isDesignTime方法的具體用法?Java Beans.isDesignTime怎麽用?Java Beans.isDesignTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.Beans
的用法示例。
在下文中一共展示了Beans.isDesignTime方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MVMapElement
import java.beans.Beans; //導入方法依賴的package包/類
MVMapElement(TLDataObject dataObject) {
// Hack
if (Beans.isDesignTime()) {
Beans.setDesignTime(false);
}
this.dataObject = dataObject;
glPanel = new TLMapGLPanel(dataObject.getDatabase().getMap(), dataObject.getDatabase());
slider = new TLSlider(dataObject.getDatabase());
elementPanel = new JPanel(new BorderLayout());
elementPanel.add(glPanel, BorderLayout.CENTER);
elementPanel.add(slider, BorderLayout.PAGE_END);
ActionMap map = new ActionMap();
map.put("save", SystemAction.get(SaveAction.class));
elementPanel.setActionMap(map);
lookupContent = new InstanceContent();
lookup = new ProxyLookup(dataObject.getLookup(), new AbstractLookup(lookupContent));
}
示例2: onLoad
import java.beans.Beans; //導入方法依賴的package包/類
@Override
public void onLoad() {
tabPanel.selectTab(0);
if (!Beans.isDesignTime()) {
Storage s = Storage.getLocalStorageIfSupported();
if (s != null) {
for (int i = 0; i < s.getLength(); i++) {
String key = s.key(i);
if ((key != null) && key.startsWith(STORAGE_KEY)) {
String name = key.substring(STORAGE_KEY.length());
storageList.addItem(name, key);
}
}
}
}
}
示例3: MapGLPanel
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Create a panel for
* @param caps
* @param map
* @param log
*/
protected MapGLPanel(GLCapabilities caps, IUnrealMap map, Logger log) {
super(caps);
if (Beans.isDesignTime()) {
Beans.setDesignTime(false);
}
this.map = map;
this.logger = log;
Location mapFocus = new Location(
map.getBox().getCenterX(),
map.getBox().getCenterY(),
map.getBox().getCenterZ());
// Stuff for controlling viewpoint in map
mapViewpoint = new MapViewpoint();
mapController = new MapController(this, mapViewpoint, mapFocus);
mapController.registerListeners();
// Create renderers
mapRenderer = new MapRenderer(map, lastGLName++);
agentRenderes = new GLRendererCollection<IRenderableUTAgent>();
environmentRenderer = new EnvironmentRenderer(mapViewpoint, agentRenderes, mapRenderer);
// Add listener so this level is rendered
this.addGLEventListener(environmentRenderer);
// Listen for changes in viewpoint
mapViewpoint.addViewpointListener(this);
// Set initial position of view + thanks to listener display
mapViewpoint.setFromViewedBox(map.getBox());
}
示例4: createMetaRuleset
import java.beans.Beans; //導入方法依賴的package包/類
@Override
protected MetaRuleset createMetaRuleset(Class type)
{
MetaRuleset m = super.createMetaRuleset(type);
// Trinidad-2014 : Converters may have id specified in the tld, but it isn't supported
if (Beans.isDesignTime())
m.ignore("id");
m.addRule(StringArrayPropertyTagRule.Instance);
m.addRule(ValueExpressionTagRule.Instance);
m.addRule(LocalePropertyTagRule.Instance);
m.addRule (TimezonePropertyTagRule.Instance);
return m;
}
示例5: _getSkinPregenerator
import java.beans.Beans; //導入方法依賴的package包/類
private static SkinPregenerator _getSkinPregenerator()
{
if (Beans.isDesignTime())
{
return _NOOP_PREGENERATOR;
}
return new AllVariantsSkinPregenerator();
}
示例6: main
import java.beans.Beans; //導入方法依賴的package包/類
public static void main(String[] args) throws InterruptedException {
if (Beans.isDesignTime()) {
throw new Error("unexpected DesignTime property");
}
Beans.setDesignTime(!Beans.isDesignTime());
ThreadGroup group = new ThreadGroup("$$$");
Thread thread = new Thread(group, new TestDesignTime());
thread.start();
thread.join();
}
示例7: isDesignTime
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Returns if design time is turned on for a Container in {@link IContainerWrapperCommon}.
*
* @param cw The container to set design time for. <code>null</code> is legal will return <code>true</code> if there is at
* least one <code>ContainerWrapper</code> (or <code>null</code>) that have design time
* turned on.
* @return If design time is set for <code>cw</code>.
*/
public boolean isDesignTime(IContainerWrapperCommon cw) {
if (dtMap == null) {
return hasBeans && Beans.isDesignTime();
}
if (cw != null && dtMap.containsKey(cw.getComponent()) == false) {
cw = null;
}
final Boolean b = dtMap.get(cw != null ? cw.getComponent() : null);
return b != null && b;
}
示例8: testSetDesignTime
import java.beans.Beans; //導入方法依賴的package包/類
public void testSetDesignTime() {
boolean value = Beans.isDesignTime();
try {
Beans.setDesignTime(true);
assertTrue(Beans.isDesignTime());
Beans.setDesignTime(false);
assertFalse(Beans.isDesignTime());
} finally {
Beans.setDesignTime(value);
}
}
示例9: getString
import java.beans.Beans; //導入方法依賴的package包/類
/**
* Retrieve a string according to the key and the current Locale.
* @param key the string's key
* @return the according string in the current user language.
*/
public static String getString(String key) {
try {
ResourceBundle bundle = Beans.isDesignTime() ? loadBundle() : RESOURCE_BUNDLE;
return bundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!";
}
}
示例10: getString
import java.beans.Beans; //導入方法依賴的package包/類
public static String getString(String key) {
try {
ResourceBundle bundle = Beans.isDesignTime() ? loadBundle() : RESOURCE_BUNDLE;
return bundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!";
}
}
示例11: getString
import java.beans.Beans; //導入方法依賴的package包/類
public static String getString(String key) {
try {
ResourceBundle bundle = Beans.isDesignTime() ? loadBundle() : RESOURCE_BUNDLE;
return bundle.getString(key);
}
catch (MissingResourceException e) {
return "!" + key + "!";
}
}
示例12: testSetDesignTime
import java.beans.Beans; //導入方法依賴的package包/類
public void testSetDesignTime() {
boolean value = Beans.isDesignTime();
try {
Beans.setDesignTime(true);
assertTrue(Beans.isDesignTime());
Beans.setDesignTime(false);
assertFalse(Beans.isDesignTime());
} finally {
Beans.setDesignTime(value);
}
}
示例13: getString
import java.beans.Beans; //導入方法依賴的package包/類
public static String getString(String key) {
try {
ResourceBundle bundle = Beans.isDesignTime() ? loadBundle() : RESOURCE_BUNDLE;
return bundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!";
}
}
示例14: getString
import java.beans.Beans; //導入方法依賴的package包/類
/**
*
* @param key key for the locale
* @param param Optional, value to replace the $PARAM placeholder with, if that exists
* @return
* @author pchr
*/
public static String getString(String key, Object param) {
try {
ResourceBundle bundle = Beans.isDesignTime() ? loadBundle() : RESOURCE_BUNDLE;
String value = bundle.getString( key );
if ( param == null ) {
param = "";
}
return value.replace( "$PARAM", (CharSequence) param );
} catch (MissingResourceException e) {
return "!" + key + "!";
}
}
示例15: getString
import java.beans.Beans; //導入方法依賴的package包/類
public static String getString(final String key) {
String returnValue;
try {
final ResourceBundle bundle = Beans.isDesignTime() ? Messages.loadBundle() : Messages.RESOURCE_BUNDLE;
returnValue = bundle.getString(key);
} catch (final MissingResourceException e) {
returnValue = '!' + key + '!';
}
return returnValue;
}