本文整理汇总了Java中java.beans.Customizer类的典型用法代码示例。如果您正苦于以下问题:Java Customizer类的具体用法?Java Customizer怎么用?Java Customizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Customizer类属于java.beans包,在下文中一共展示了Customizer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CustomizerDialog
import java.beans.Customizer; //导入依赖的package包/类
/**
* Constructor taking the parent frame, the customizer component
* and the target bean as arguments.
*/
public CustomizerDialog(Frame frame, Customizer customizer, Object target) {
super(frame, customizer.getClass().getName(), true);
setLayout(null);
body = (Component) customizer;
add(body);
doneButton = new Button("Done");
doneButton.addActionListener(this);
add(doneButton);
int x = frame.getLocation().x + 30;
int y = frame.getLocation().y + 100;
setLocation(x, y);
setVisible(true);
}
示例2: setValues
import java.beans.Customizer; //导入依赖的package包/类
/**
* Get values from element to fill propertyMap and setup customizer
* @param element TestElement
*/
private void setValues(TestElement element) {
// Copy all property values into the map:
for (PropertyIterator jprops = element.propertyIterator(); jprops.hasNext();) {
JMeterProperty jprop = jprops.next();
propertyMap.put(jprop.getName(), jprop.getObjectValue());
}
if (customizer != null) {
customizer.setObject(propertyMap);
} else {
if (initialized){
remove(customizerIndexInPanel);
}
Customizer c = customizers.get(element);
if (c == null) {
c = createCustomizer();
c.setObject(propertyMap);
customizers.put(element, c);
}
add((Component) c, BorderLayout.CENTER);
}
}
示例3: getCustomizer
import java.beans.Customizer; //导入依赖的package包/类
@Override
public Customizer getCustomizer(String volumeType) {
if (VOLUME_TYPES[0].equals(volumeType)||
VOLUME_TYPES[1].equals(volumeType)||
VOLUME_TYPES[2].equals(volumeType)) {
return new J2SEVolumeCustomizer (volumeType);
}
else {
return null;
}
}
示例4: initComponents
import java.beans.Customizer; //导入依赖的package包/类
private void initComponents () {
this.getAccessibleContext().setAccessibleName (NbBundle.getMessage(J2SEPlatformCustomizer.class,"AN_J2SEPlatformCustomizer"));
this.getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(J2SEPlatformCustomizer.class,"AD_J2SEPlatformCustomizer"));
this.addTab(NbBundle.getMessage(J2SEPlatformCustomizer.class,"TXT_Classes"), createPathTab(CLASSPATH));
this.addTab(NbBundle.getMessage(J2SEPlatformCustomizer.class,"TXT_Sources"), createPathTab(SOURCES));
this.addTab(NbBundle.getMessage(J2SEPlatformCustomizer.class,"TXT_Javadoc"), createPathTab(JAVADOC));
final Lookup lkp = Lookups.forPath(CUSTOMIZERS_PATH);
final boolean isDefaultPlatform = platform instanceof DefaultPlatformImpl;
for (Lookup.Item<? extends Customizer> li : lkp.lookupResult(Customizer.class).allItems()) {
final Customizer c = li.getInstance();
if (!(c instanceof Component)) {
continue;
}
String name = li.getId();
final FileObject fo = FileUtil.getConfigFile(String.format("%s.instance",name)); //NOI18N
if (fo != null) {
try {
name = fo.getFileSystem().getDecorator().annotateName(fo.getName(), Collections.<FileObject>singleton(fo));
} catch (FileStateInvalidException ex) {
name = fo.getName();
}
if (isDefaultPlatform &&
fo.getAttribute(SUPPORTS_DEFAULT_PLATFORM) == Boolean.FALSE) {
continue;
}
}
c.setObject(platform);
this.addTab(name, (Component)c);
}
}
示例5: remove
import java.beans.Customizer; //导入依赖的package包/类
private void remove(JPDAThread t) {
((Customizer) t).removePropertyChangeListener(this);
//System.err.println("AllThreadsAnnotator("+Integer.toHexString(debugger.hashCode())+").remove("+t+")");
synchronized (this) {
Object annotation = threadAnnotations.remove(t);
if (annotation != null) {
threadsToAnnotate.remove(t);
annotationsToRemove.add(annotation);
task.schedule(ANNOTATION_SCHEDULE_TIME);
}
}
}
示例6: propertyChange
import java.beans.Customizer; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
synchronized (this) {
if (!active) {
((Customizer) evt.getSource()).removePropertyChangeListener(this);
return ;
}
}
JPDAThread t = (JPDAThread) evt.getSource();
annotate(t);
}
示例7: destroyThreadStateListeners
import java.beans.Customizer; //导入依赖的package包/类
private void destroyThreadStateListeners() {
synchronized (threadStateListeners) {
for (Map.Entry<JPDAThread, ThreadStateListener> entry : threadStateListeners.entrySet()) {
PropertyChangeListener pcl = entry.getValue().getThreadPropertyChangeListener();
((Customizer) entry.getKey()).removePropertyChangeListener(pcl);
}
threadStateListeners.clear();
}
}
示例8: getChildren
import java.beans.Customizer; //导入依赖的package包/类
public Object[] getChildren (Object o, int from, int to)
throws UnknownTypeException {
Object[] ch = getChildrenImpl(o, from, to);
for (int i = 0; i < ch.length; i++) {
if (ch[i] instanceof Customizer) {
((Customizer) ch[i]).addPropertyChangeListener(this);
}
}
return ch;
}
示例9: getCustomizer
import java.beans.Customizer; //导入依赖的package包/类
private Customizer getCustomizer(Breakpoint b) {
Class cc = getCustomizerClass(b);
if (cc == null) return null;
try {
Customizer c = (Customizer) cc.newInstance();
c.setObject(b);
return c;
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
return null;
}
}
示例10: DeadlockDetectorImpl
import java.beans.Customizer; //导入依赖的package包/类
DeadlockDetectorImpl(JPDADebugger debugger) {
debugger.addPropertyChangeListener(this);
List<JPDAThread> threads = debugger.getThreadsCollector().getAllThreads();
for (JPDAThread thread : threads) {
((Customizer) thread).addPropertyChangeListener(WeakListeners.propertyChange(this, thread));
if (thread.isSuspended()) {
synchronized (suspendedThreads) {
suspendedThreads.add(thread);
}
}
}
}
示例11: popupCustomizer
import java.beans.Customizer; //导入依赖的package包/类
/**
* Popup the customizer for this bean
*
* @param custClass the class of the customizer
* @param bc the bean to be customized
*/
private void popupCustomizer(Class custClass, JComponent bc) {
try {
// instantiate
final Object customizer = custClass.newInstance();
// set environment **before** setting object!!
if (customizer instanceof EnvironmentHandler) {
((EnvironmentHandler) customizer).setEnvironment(m_flowEnvironment);
}
((Customizer) customizer).setObject(bc);
final javax.swing.JFrame jf = new javax.swing.JFrame();
jf.getContentPane().setLayout(new BorderLayout());
jf.getContentPane().add((JComponent) customizer, BorderLayout.CENTER);
if (customizer instanceof CustomizerCloseRequester) {
((CustomizerCloseRequester) customizer).setParentFrame(jf);
}
jf.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
if (customizer instanceof CustomizerClosingListener) {
((CustomizerClosingListener) customizer).customizerClosing();
}
jf.dispose();
}
});
jf.pack();
jf.setVisible(true);
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例12: add
import java.beans.Customizer; //导入依赖的package包/类
private void add(JPDAThread t) {
((Customizer) t).addPropertyChangeListener(this);
//System.err.println("AllThreadsAnnotator("+Integer.toHexString(debugger.hashCode())+").add("+t+")");
annotate(t);
}
示例13: ThreadStateUpdater
import java.beans.Customizer; //导入依赖的package包/类
public ThreadStateUpdater(JPDAThread t) {
this.tr = new WeakReference(t);
((Customizer) t).addPropertyChangeListener(WeakListeners.propertyChange(this, t));
}
示例14: ThreadStateListener
import java.beans.Customizer; //导入依赖的package包/类
public ThreadStateListener(JPDAThread t) {
this.tr = new WeakReference(t);
this.propertyChangeListener = WeakListeners.propertyChange(this, t);
((Customizer) t).addPropertyChangeListener(propertyChangeListener);
}
示例15: selectLibrary
import java.beans.Customizer; //导入依赖的package包/类
private void selectLibrary (Node[] nodes) {
int tabCount = this.properties.getTabCount();
for (int i=0; i<tabCount; i++) {
this.properties.removeTabAt(0);
}
this.libraryName.setEnabled(false);
this.libraryName.setText(""); //NOI18N
this.jLabel1.setVisible(false);
this.libraryName.setVisible(false);
this.properties.setVisible(false);
this.deleteButton.setEnabled(false);
if (nodes.length != 1) {
return;
}
LibraryImplementation impl = nodes[0].getLookup().lookup(LibraryImplementation.class);
if (impl == null) {
return;
}
this.jLabel1.setVisible(true);
this.libraryName.setVisible(true);
this.properties.setVisible(true);
boolean editable = model.isLibraryEditable (impl);
this.libraryName.setEnabled(editable && LibrariesSupport.supportsDisplayName(impl));
this.deleteButton.setEnabled(editable);
this.libraryName.setText (LibrariesSupport.getLocalizedName(impl));
LibraryTypeProvider provider = nodes[0].getLookup().lookup(LibraryTypeProvider.class);
if (provider == null) {
return;
}
LibraryCustomizerContextWrapper customizerContext;
LibraryStorageArea area = nodes[0].getLookup().lookup(LibraryStorageArea.class);
if (area != LibraryStorageArea.GLOBAL) {
customizerContext = new LibraryCustomizerContextWrapper(impl, area);
File f = Utilities.toFile(URI.create(area.getLocation().toExternalForm()));
this.libraryLocation.setText(f.getPath());
} else {
customizerContext = new LibraryCustomizerContextWrapper(impl, null);
this.libraryLocation.setText(LABEL_Global_Libraries());
}
String[] volumeTypes = provider.getSupportedVolumeTypes();
for (int i=0; i< volumeTypes.length; i++) {
Customizer c = provider.getCustomizer (volumeTypes[i]);
if (c instanceof JComponent) {
c.setObject (customizerContext);
JComponent component = (JComponent) c;
component.setEnabled (editable);
String tabName = component.getName();
if (tabName == null) {
tabName = volumeTypes[i];
}
this.properties.addTab(tabName, component);
}
}
}