private Variable showDialog() {
JPanel inset = new JPanel(new BorderLayout());
inset.setBorder(new EmptyBorder(12,12,0,12));
inset.add(this);
inset.getAccessibleContext().setAccessibleName(NbBundle.getMessage(VariablesPanel.class, "AN_Manage_Variables"));
inset.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(VariablesPanel.class, "AD_Manage_Variables"));
DialogDescriptor dd = new DialogDescriptor(inset, NbBundle.getMessage(VariablesPanel.class, "TITLE_Manage_Variables")); // NOI18N
dd.setModal(true);
final JButton ok = new JButton(NbBundle.getMessage(VariablesPanel.class, "BUTTON_OK")); // NOI18N
ok.setDefaultCapable(true);
explorer.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
removeButton.setEnabled(explorer.getSelectedNodes().length > 0);
editButton.setEnabled(explorer.getSelectedNodes().length == 1);
}
});
dd.setOptions(new Object[] {ok, NotifyDescriptor.CANCEL_OPTION});
dd.setClosingOptions(new Object[] {ok, NotifyDescriptor.CANCEL_OPTION});
if (DialogDisplayer.getDefault().notify(dd) == ok) {
model.save();
if (explorer.getSelectedNodes().length == 1) {
return explorer.getSelectedNodes()[0].getLookup().lookup(Variable.class);
}
}
return null;
}
java类java.beans.PropertyChangeEvent的实例源码
VariablesPanel.java 文件源码
项目:incubator-netbeans
阅读 24
收藏 0
点赞 0
评论 0
Toolkit.java 文件源码
项目:openjdk-jdk10
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void firePropertyChange(final PropertyChangeEvent evt) {
Object oldValue = evt.getOldValue();
Object newValue = evt.getNewValue();
String propertyName = evt.getPropertyName();
if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
return;
}
Runnable updater = new Runnable() {
public void run() {
PropertyChangeSupport pcs = (PropertyChangeSupport)
AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
if (null != pcs) {
pcs.firePropertyChange(evt);
}
}
};
final AppContext currentAppContext = AppContext.getAppContext();
for (AppContext appContext : AppContext.getAppContexts()) {
if (null == appContext || appContext.isDisposed()) {
continue;
}
if (currentAppContext == appContext) {
updater.run();
} else {
final PeerEvent e = new PeerEvent(source, updater, PeerEvent.ULTIMATE_PRIORITY_EVENT);
SunToolkit.postEvent(appContext, e);
}
}
}
ProxyNode.java 文件源码
项目:incubator-netbeans
阅读 13
收藏 0
点赞 0
评论 0
private void realPropertyChange(PropertyChangeEvent pce) {
String nm = pce.getPropertyName();
Node.PropertySet[] pss = getPropertySets();
boolean exists = false;
for (int i = 0; i < pss.length && !exists; i++) {
Node.Property[] ps = pss[i].getProperties();
for (int j = 0; j < ps.length && !exists; j++) {
if (ps[j].getName().equals(nm)) {
exists = true;
}
}
}
if( exists ) {
firePropertyChange(pce.getPropertyName(), pce.getOldValue(), pce.getNewValue());
}
}
FxTreeMap.java 文件源码
项目:FxTreeMap
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (TreeMapUtils.ITEM_CLICKED.equals(evt.getPropertyName())) {
MapData data = (MapData) evt.getNewValue();
if (!mapLevels.containsKey(data)) {
FxMapModel newDataModel = new FxMapModel(this, data, 0, 0);
newDataModel.setTreeMapStyle(style);
mapLevels.put(data, newDataModel);
currentModel = newDataModel;
} else {
currentModel = mapLevels.get(data);
}
currentData = data;
updateBreadCrumbBar();
pane.getChildren().setAll(currentModel.getFxItems().stream().map(i -> i.getNode()).collect(Collectors.toList()));
requestLayoutUpdate();
}
}
BeanEventSample.java 文件源码
项目:intellij-deps-ini4j
阅读 16
收藏 0
点赞 0
评论 0
public static void main(String[] args) throws Exception
{
String filename = (args.length > 0) ? args[0] : FILENAME;
Ini ini = new Ini(new FileInputStream(filename));
Dwarf sneezy = ini.get("sneezy").as(Dwarf.class);
sneezy.addPropertyChangeListener("age", new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent event)
{
System.out.println("property " + event.getPropertyName() + " change");
System.out.println(event.getOldValue() + " -> " + event.getNewValue());
}
});
System.out.println("Sneezy's age: " + sneezy.getAge());
sneezy.setAge(44);
System.out.println("Sneezy's age: " + sneezy.getAge());
}
MotifInternalFrameTitlePane.java 文件源码
项目:OpenJSharp
阅读 14
收藏 0
点赞 0
评论 0
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
JInternalFrame f = (JInternalFrame)evt.getSource();
boolean value = false;
if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
repaint();
} else if (prop.equals("maximizable")) {
if ((Boolean)evt.getNewValue() == Boolean.TRUE)
add(maximizeButton);
else
remove(maximizeButton);
revalidate();
repaint();
} else if (prop.equals("iconable")) {
if ((Boolean)evt.getNewValue() == Boolean.TRUE)
add(minimizeButton);
else
remove(minimizeButton);
revalidate();
repaint();
} else if (prop.equals(JInternalFrame.TITLE_PROPERTY)) {
repaint();
}
enableActions();
}
AXIComponent.java 文件源码
项目:incubator-netbeans
阅读 15
收藏 0
点赞 0
评论 0
/**
* The proxy component receives an event notification.
*/
public void propertyChange(PropertyChangeEvent evt) {
AXIComponent source = (AXIComponent)evt.getSource();
String property = evt.getPropertyName();
if(!isInModel()) {
//Ideally it shouldn't come here. Remove this as listener
//and make shared as null, so that it'll be GCed.
source.removeListener(this);
//setSharedComponent(null);
return;
}
//if(evt.getOldValue() == null && evt.getNewValue() != null) {
if(PROP_CHILD_ADDED.equals(property)) {
onChildAdded(evt);
return;
}
//if(evt.getOldValue() != null && evt.getNewValue() == null) {
if(PROP_CHILD_REMOVED.equals(property)) {
onChildDeleted(evt);
return;
}
firePropertyChangeEvent(evt.getPropertyName(),
evt.getOldValue(), evt.getNewValue());
}
ToggleBreakpointActionProvider.java 文件源码
项目:incubator-netbeans
阅读 15
收藏 0
点赞 0
评论 0
@Override
public void propertyChange (PropertyChangeEvent evt) {
String url = EditorContextBridge.getContext().getCurrentURL();
FileObject fo;
try {
fo = URLMapper.findFileObject(new URL(url));
} catch (MalformedURLException muex) {
fo = null;
}
setEnabled (
ActionsManager.ACTION_TOGGLE_BREAKPOINT,
(EditorContextBridge.getContext().getCurrentLineNumber () >= 0) &&
(fo != null && "text/x-java".equals(fo.getMIMEType())) // NOI18N
//(EditorContextBridge.getCurrentURL ().endsWith (".java"))
);
if ( debugger != null &&
debugger.getState () == JPDADebugger.STATE_DISCONNECTED
)
destroy ();
}
FileSystemView.java 文件源码
项目:OpenJSharp
阅读 19
收藏 0
点赞 0
评论 0
public FileSystemView() {
final WeakReference<FileSystemView> weakReference = new WeakReference<FileSystemView>(this);
UIManager.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
FileSystemView fileSystemView = weakReference.get();
if (fileSystemView == null) {
// FileSystemView was destroyed
UIManager.removePropertyChangeListener(this);
} else {
if (evt.getPropertyName().equals("lookAndFeel")) {
fileSystemView.useSystemExtensionHiding =
UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
}
}
}
});
}
OpenSupport.java 文件源码
项目:incubator-netbeans
阅读 17
收藏 0
点赞 0
评论 0
/** Accepts property changes from DataObject and fires them to
* own listeners.
*/
public void propertyChange(PropertyChangeEvent ev) {
if (DataObject.PROP_MODIFIED.equals (ev.getPropertyName())) {
if (getDataObject ().isModified ()) {
getDataObject ().addVetoableChangeListener(this);
} else {
getDataObject ().removeVetoableChangeListener(this);
}
}
firePropertyChange (
ev.getPropertyName (),
ev.getOldValue (),
ev.getNewValue ()
);
}
PersistenceUnitWizardDescriptor.java 文件源码
项目:incubator-netbeans
阅读 15
收藏 0
点赞 0
评论 0
@Override
public java.awt.Component getComponent() {
if (panel == null) {
if (isContainerManaged) {
datasourcePanel = new PersistenceUnitWizardPanelDS(project, this, true);
panel = datasourcePanel;
} else {
jdbcPanel= new PersistenceUnitWizardPanelJdbc(project, this, true);
panel = jdbcPanel;
}
panel.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(PersistenceUnitWizardPanel.IS_VALID)) {
Object newvalue = evt.getNewValue();
if ((newvalue != null) && (newvalue instanceof Boolean)) {
stateChanged(null);
}
}
}
});
}
return panel;
}
JPDAStart.java 文件源码
项目:incubator-netbeans
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void propertyChange (final PropertyChangeEvent e) {
if (JPDADebugger.PROP_STATE.equals(e.getPropertyName ())) {
int state = ((Integer) e.getNewValue ()).intValue ();
if (state == JPDADebugger.STATE_STOPPED || state == JPDADebugger.STATE_DISCONNECTED) {
rp.post(new Runnable() {
@Override
public void run() {
if (first != null) {
DebuggerManager.getDebuggerManager().removeBreakpoint(first);
first = null;
((JPDADebugger) e.getSource()).removePropertyChangeListener(JPDADebugger.PROP_STATE, pcl);
}
}
});
}
}
}
EditorContextDispatcher.java 文件源码
项目:incubator-netbeans
阅读 15
收藏 0
点赞 0
评论 0
@Override
public void propertyChange(PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if (logger.isLoggable(Level.FINE)) {
logger.fine("EditorRegistryListener.propertyChange("+propertyName+": "+evt.getOldValue()+" => "+evt.getNewValue()+")");
}
if (propertyName.equals(EditorRegistry.FOCUS_LOST_PROPERTY)) {
Object newFocused = evt.getNewValue();
if (newFocused instanceof JRootPane) {
JRootPane root = (JRootPane) newFocused;
if (root.isAncestorOf((Component) evt.getOldValue())) {
logger.fine("Focused root.");
root.addFocusListener(this);
return;
}
}
}
if (propertyName.equals(EditorRegistry.FOCUS_GAINED_PROPERTY) ||
propertyName.equals(EditorRegistry.FOCUS_LOST_PROPERTY) ||
propertyName.equals(EditorRegistry.FOCUSED_DOCUMENT_PROPERTY)) {
update(true);
}
}
JPDAStart.java 文件源码
项目:incubator-netbeans
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void propertyChange(PropertyChangeEvent e) {
if (JPDADebugger.PROP_STATE.equals(e.getPropertyName())) {
int state = ((Integer) e.getNewValue()).intValue();
if ( (state == JPDADebugger.STATE_DISCONNECTED) ||
(state == JPDADebugger.STATE_STOPPED)
) {
// RequestProcessor.getDefault ().post (new Runnable () {
// public void run () {
if (breakpoint != null) {
DebuggerManager.getDebuggerManager().
removeBreakpoint(breakpoint);
breakpoint = null;
}
// }
// });
dispose();
}
}
}
TitledBorder.java 文件源码
项目:openjdk-jdk10
阅读 23
收藏 0
点赞 0
评论 0
private void installPropertyChangeListeners() {
final WeakReference<TitledBorder> weakReference = new WeakReference<TitledBorder>(this);
final PropertyChangeListener listener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (weakReference.get() == null) {
UIManager.removePropertyChangeListener(this);
UIManager.getDefaults().removePropertyChangeListener(this);
} else {
String prop = evt.getPropertyName();
if ("lookAndFeel".equals(prop) || "LabelUI".equals(prop)) {
label.updateUI();
}
}
}
};
UIManager.addPropertyChangeListener(listener);
UIManager.getDefaults().addPropertyChangeListener(listener);
}
ChooseCategoryWizardPanel.java 文件源码
项目:incubator-netbeans
阅读 17
收藏 0
点赞 0
评论 0
@Override
public java.awt.Component getComponent() {
if (categorySelector == null) { // create the UI component for the wizard step
categorySelector = new CategorySelector();
// wizard API: set the caption and index of this panel
categorySelector.setName(PaletteUtils.getBundleString("CTL_SelectCategory_Caption")); // NOI18N
categorySelector.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, // NOI18N
Integer.valueOf(2));
categorySelector.getExplorerManager().addPropertyChangeListener(
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent ev) {
if (ExplorerManager.PROP_SELECTED_NODES.equals(ev.getPropertyName()))
cs.fireChange();
}
});
}
return categorySelector;
}
RepositoryInfo.java 文件源码
项目:incubator-netbeans
阅读 18
收藏 0
点赞 0
评论 0
private void setActiveBranch (Map<String, GitBranch> branches) throws GitException {
for (Map.Entry<String, GitBranch> e : branches.entrySet()) {
if (e.getValue().isActive()) {
GitBranch oldActiveBranch = activeBranch;
activeBranch = e.getValue();
if (oldActiveBranch == null || !oldActiveBranch.getName().equals(activeBranch.getName())) {
LOG.log(Level.FINE, "active branch changed: {0} --- {1}", new Object[] { rootRef, activeBranch.getName() }); //NOI18N
firePropertyChange(new PropertyChangeEvent(this, PROPERTY_ACTIVE_BRANCH, oldActiveBranch, activeBranch));
}
if (oldActiveBranch == null || !oldActiveBranch.getId().equals(activeBranch.getId())) {
LOG.log(Level.FINE, "current HEAD changed: {0} --- {1}", new Object[] { rootRef, activeBranch.getId() }); //NOI18N
firePropertyChange(new PropertyChangeEvent(this, PROPERTY_HEAD, oldActiveBranch, activeBranch));
}
}
}
}
ShowServerStatusAction.java 文件源码
项目:VASSAL-src
阅读 17
收藏 0
点赞 0
评论 0
public void propertyChange(PropertyChangeEvent evt) {
MessageBoard server = null;
String name = null;
if (evt.getNewValue() instanceof ServerStatus.ModuleSummary) {
final String moduleName = ((ServerStatus.ModuleSummary) evt.getNewValue()).getModuleName();
server = new HttpMessageServer(new PeerPoolInfo() {
public String getModuleName() {
return moduleName;
}
public String getUserName() {
return ((ChatServerConnection) GameModule.getGameModule().getServer()).getUserInfo().getName();
}
});
}
if (messageMgr != null) {
messageMgr.setServer(server, name);
}
}
ResourceTable.java 文件源码
项目:incubator-netbeans
阅读 17
收藏 0
点赞 0
评论 0
private void fireEventAndCleanList(ArrayList <WeakReference<PropertyChangeListener>> refListeners,
PropertyChangeEvent event)
{
for(int index = refListeners.size() - 1; index >= 0; index--)
{
WeakReference<PropertyChangeListener> ref = refListeners.get(index);
PropertyChangeListener refListener = ref.get();
if(refListener != null)
{
refListener.propertyChange(event);
}
else
{
refListeners.remove(index);
}
}
}
MotifScrollPaneUI.java 文件源码
项目:openjdk-jdk10
阅读 17
收藏 0
点赞 0
评论 0
private PropertyChangeListener createPropertyChangeHandler() {
return new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
String propertyName = e.getPropertyName();
if (propertyName.equals("componentOrientation")) {
JScrollPane pane = (JScrollPane)e.getSource();
JScrollBar vsb = pane.getVerticalScrollBar();
if (vsb != null && vsbBorder != null &&
vsb.getBorder() == vsbBorder) {
// The Border on the verticall scrollbar matches
// what we installed, reset it.
if (MotifGraphicsUtils.isLeftToRight(pane)) {
vsbBorder = new CompoundBorder(vsbMarginBorderR,
vsbBorder.getInsideBorder());
} else {
vsbBorder = new CompoundBorder(vsbMarginBorderL,
vsbBorder.getInsideBorder());
}
vsb.setBorder(vsbBorder);
}
}
}};
}
RepositoryNode.java 文件源码
项目:incubator-netbeans
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(RepositoryImpl.EVENT_QUERY_LIST_CHANGED)) {
updateContent(false);
} else if (evt.getPropertyName().equals(RepositoryImpl.EVENT_ATTRIBUTES_CHANGED)) {
if (evt.getNewValue() instanceof Map) {
Map<String, String> attributes = (Map<String, String>) evt.getNewValue();
String displayName = attributes.get(RepositoryImpl.ATTRIBUTE_DISPLAY_NAME);
if (displayName != null && !displayName.isEmpty()) {
if (lblName != null) {
lblName.setText(displayName);
fireContentChanged();
}
}
}
}
}
BooleanPreference.java 文件源码
项目:VASSAL-src
阅读 14
收藏 0
点赞 0
评论 0
public Configurer getPreferenceConfigurer() {
if (config == null) {
config = new BooleanConfigurer(getVariableName(), getDescription(), defaultValue);
config.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
updateGlobalProperty(config.getValueString());
}});
}
return config;
}
SyncPlayer.java 文件源码
项目:jaer
阅读 20
收藏 0
点赞 0
评论 0
/** JAERViewer gets PropertyChangeEvent from the AEPlayer in the AEViewers. This method presently only logs this event.
*/
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(AEInputStream.EVENT_REWIND)) {
// comes from AEFileInputStream when file reaches end and AEViewer rewinds the file
for (AEViewer v : outer.getViewers()) {
v.getChip().getRenderer().resetFrame(v.getChip().getRenderer().getGrayValue());
}
log.info("rewind PropertyChangeEvent received by " + this + " from " + evt.getSource());
}
}
CustomCodeEditor.java 文件源码
项目:incubator-netbeans
阅读 15
收藏 0
点赞 0
评论 0
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName())
&& evt.getNewValue() == PropertyEnv.STATE_VALID) {
propertyEditor.setValue(codeEditorPane.getText());
}
}
AncestorNotifier.java 文件源码
项目:openjdk-jdk10
阅读 24
收藏 0
点赞 0
评论 0
public void propertyChange(PropertyChangeEvent evt) {
String s = evt.getPropertyName();
if (s!=null && (s.equals("parent") || s.equals("ancestor"))) {
JComponent component = (JComponent)evt.getSource();
if (evt.getNewValue() != null) {
if (component == firstInvisibleAncestor) {
addListeners(component, false);
if (firstInvisibleAncestor == null) {
fireAncestorAdded(root, AncestorEvent.ANCESTOR_ADDED,
component, component.getParent());
}
}
} else {
boolean needsNotify = firstInvisibleAncestor == null;
Container oldParent = (Container)evt.getOldValue();
removeListeners(oldParent);
firstInvisibleAncestor = component;
if (needsNotify) {
fireAncestorRemoved(root, AncestorEvent.ANCESTOR_REMOVED,
component, oldParent);
}
}
}
}
FileChooserUI.java 文件源码
项目:rapidminer
阅读 23
收藏 0
点赞 0
评论 0
private void doSelectedFileChanged(PropertyChangeEvent e) {
File f = (File) e.getNewValue();
JFileChooser fc = getFileChooser();
if (f != null && (fc.isFileSelectionEnabled() && !f.isDirectory()
|| f.isDirectory() && fc.isDirectorySelectionEnabled())) {
setFileName(fileNameString(f));
setFileSelected();
}
}
AddPropertyDialog.java 文件源码
项目:incubator-netbeans
阅读 18
收藏 0
点赞 0
评论 0
/** Creates new form AddPropertyDialog */
public AddPropertyDialog(NbMavenProjectImpl prj, String goalsText) {
initComponents();
manager = new ExplorerManager();
//project can be null when invoked from Tools/Options
project = prj;
okbutton = new JButton(NbBundle.getMessage(AddPropertyDialog.class, "BTN_OK"));
manager.setRootContext(Node.EMPTY);
tpDesc.setEditorKit(new HTMLEditorKit());
tpDesc.putClientProperty( JTextPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE );
manager.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
Node[] nds = getExplorerManager().getSelectedNodes();
if (nds.length != 1) {
okbutton.setEnabled(false);
} else {
PluginIndexManager.ParameterDetail plg = nds[0].getLookup().lookup(PluginIndexManager.ParameterDetail.class);
if (plg != null) {
okbutton.setEnabled(true);
tpDesc.setText(plg.getHtmlDetails(false));
} else {
okbutton.setEnabled(false);
tpDesc.setText("");
}
}
}
});
((BeanTreeView)tvExpressions).setRootVisible(false);
((BeanTreeView)tvExpressions).setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
this.goalsText = goalsText;
RequestProcessor.getDefault().post(new Loader());
}
BasicSlidingTabDisplayerUI.java 文件源码
项目:incubator-netbeans
阅读 25
收藏 0
点赞 0
评论 0
@Override
public void propertyChange(PropertyChangeEvent e) {
super.propertyChange(e);
if (TabDisplayer.PROP_ORIENTATION.equals(e.getPropertyName())) {
displayer.revalidate();
}
}
RegularGridNumbering.java 文件源码
项目:VASSAL-src
阅读 15
收藏 0
点赞 0
评论 0
public Configurer getConfigurer() {
AutoConfigurer c = (AutoConfigurer) super.getConfigurer();
String[] s = getAttributeNames();
for (int i = 0; i < s.length; ++i) {
c.getConfigurer(s[i]).addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
visualizer.repaint();
}
});
}
((Container) c.getControls()).add(getGridVisualizer());
return c;
}
FileConfigurer.java 文件源码
项目:VASSAL-src
阅读 13
收藏 0
点赞 0
评论 0
public static void main(String args[]) {
final JFrame f = new JFrame();
final FileConfigurer c =
new ImageConfigurer(null, "Test file", new ArchiveWriter("testArchive"));
c.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
System.err.println(String.valueOf(evt.getNewValue()));
}
});
f.getContentPane().add(c.getControls());
f.pack();
f.setVisible(true);
}