Mutex.EVENT.readAccess(new Runnable() { public void run() { clearActionPerformers();
@Override public void resultChanged(LookupEvent ev) { Mutex.EVENT.readAccess(this); }
/** Returns title of the displayed page. * @return title */ public String getTitle() { if (title == null) { Mutex.EVENT.readAccess(this); } return (title == null) ? NbBundle.getMessage(SwingBrowserImpl.class, "LBL_Loading") : title; //NOI18N }
/** Setter for selected list item. * @param index Index of selected item in the list. */ public void setSelectedIndex(final int index) { selectedIndex = index; if (cellRenderer != null) { cellRenderer.setSelectedIndex(index); final JList list = contentList; if (list == null) { return; } // #18055. See previous #18055 comment. Mutex.EVENT.readAccess( new Runnable() { @Override public void run() { list.ensureIndexIsVisible(index); // Fix of #10787. // This is workaround for swing bug - BasicListUI doesn't ask for preferred // size of rendered list cell as a result of property selectedIndex change. // It does only on certain JList property changes (e.g. fixedCellWidth). // Maybe subclassing BasicListUI could be better fix. list.setFixedCellWidth(0); list.setFixedCellWidth(-1); } } ); } }
public void propertyChange(PropertyChangeEvent ev) { // filter only cookie classes changes if (!Node.PROP_COOKIE.equals(ev.getPropertyName())) { return; } // find asociated action Mutex.EVENT.readAccess(this); }
public @Override void close() throws IOException { openStream(); super.close(); Mutex.EVENT.readAccess(browser); }
/** Checks the state of the action. * Or rather, it just forgets it ever knew. * @param sfc if true, only survive-focus-change actions affected, else only not-s-f-c */ private void forget(boolean sfc) { List<NodeAction> as; synchronized (listeningActions) { as = new ArrayList<NodeAction>(listeningActions.size()); for (Iterator<NodeAction> it = listeningActions.iterator(); it.hasNext();) { as.add(it.next()); } } Iterator<NodeAction> it = as.iterator(); while (it.hasNext()) { final NodeAction a = it.next(); if (a.surviveFocusChange() == sfc) { Mutex.EVENT.readAccess(new Runnable() { public void run() { a.maybeFireEnabledChange(); } }); } } } }
Mutex.EVENT.readAccess(new Runnable() { public void run() { clearActionPerformers();
Mutex.EVENT.readAccess(new Runnable() { @Override public void run() {
Mutex.EVENT.readAccess( new Runnable() { @Override
/** Invoke an indexed customizer. */ static void showIndexedCustomizer(Index idx) { try { TALK.set(idx); if (!exec("IndexC")) { // NOI18N // Fallback to simple method. final IndexedCustomizer ic = new IndexedCustomizer(); ic.setObject(idx); ic.setImmediateReorder(false); Mutex.EVENT.readAccess( new Mutex.Action<Void>() { public Void run() { ic.setVisible(true); return null; } } ); } } finally { TALK.set(null); } }
final JComponent progressComp = ProgressHandleFactory.createProgressComponent (handle); final JLabel detailComp = ProgressHandleFactory.createDetailLabelComponent (handle); Mutex.EVENT.readAccess( new Runnable() { @Override public void run() { Mutex.EVENT.readAccess( new Runnable() { @Override public void run() {
@Override public void validate() { Children.MUTEX.readAccess(new Runnable() { @Override public void run() { TreeView.super.validate(); } }); }
final void fireInAWT(final String propName, final Object oldVal, final Object newVal) { if (propertySupport != null) { Mutex.EVENT.readAccess( new Runnable() { public void run() { propertySupport.firePropertyChange(propName, oldVal, newVal); } } ); } }
public void stateChanged(final int oldState, final int newState) { Mutex.EVENT.readAccess(new Runnable() { public void run() { firePropertyChange( PROP_ENABLED, null, isEnabled() ? Boolean.TRUE : Boolean.FALSE); } }); } }
private void readPrivateProperties () { ProjectManager.mutex().readAccess(new Runnable() { public void run () { appArgs = project.getUpdateHelper().getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH).getProperty(J2SEProjectProperties.APPLICATION_ARGS); workDir = project.getUpdateHelper().getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH).getProperty(J2SEProjectProperties.RUN_WORK_DIR); } }); }
private String doLoad(final String name) { return ProjectManager.mutex().readAccess(new Mutex.Action<String>() { @Override public String run() { Element configurationFragment = getConfigurationFragment(); if (configurationFragment == null) { return null; } return getNode(configurationFragment, name).getTextContent(); } }); }
@Override public void propertyChange(@NonNull final PropertyChangeEvent evt) { Mutex.EVENT.readAccess(()-> { int up = platforms == null ? 0 : platforms.length; init(); up = Math.max(up, platforms.length); fireContentsChanged(this, 0, up); }); } }
public GuardedActions(int type, Object p1) { this.type = type; this.p1 = p1; if (Children.MUTEX.isReadAccess() || Children.MUTEX.isWriteAccess()) { ret = run(); } else { ret = Children.MUTEX.readAccess(this); } }
public GuardedActions(int type, Object p1) { this.type = type; this.p1 = p1; if (Children.MUTEX.isReadAccess() || Children.MUTEX.isWriteAccess()) { ret = run(); } else { ret = Children.MUTEX.readAccess(this); } }