void hideEmpty(final Set<Entry> entries, final Entry entry) { Children.MUTEX.postWriteRequest(new Runnable() { @Override public void run() { EntrySupportLazyState[] stateHolder = { internal.get() }; removeEntries(stateHolder, entries, entry, null, true, true); } }); }
public void reorder(final int[] perm) { MUTEX.postWriteRequest(new Runnable() { public void run() { Node[] n = nodes.toArray(new Node[nodes.size()]); List<Node> l = (List<Node>) nodes; for (int i = 0; i < n.length; i++) { l.set(perm[i], n[i]); } refresh(); } }); }
/** Refresh the child nodes for a given key. * * @param key the key to refresh */ protected final void refreshKey(final T key) { MUTEX.postWriteRequest( new Runnable() { public void run() { Keys.this.entrySupport().refreshEntry(createEntryForKey(key)); } } ); }
Children.MUTEX.postWriteRequest( new Runnable() { public void run() {
/** Applies the keys. */ private void applyKeys(final List<? extends Entry> l) { Runnable invoke = new Runnable() { public void run() { if (keysCheck(Keys.this, this)) { // no next request after me entrySupport().setEntries(l); // clear this runnable keysExit(Keys.this, this); } } }; keysEnter(this, invoke); MUTEX.postWriteRequest(invoke); }
/** This method can be called by subclasses that * directly modify the nodes collection to update the * state of the nodes appropriatelly. */ protected final void refresh() { checkSupport(); if (lazySupport) { return; } MUTEX.postWriteRequest(new Runnable() { public void run() { refreshImpl(); } } ); }
@Override public void update() { final boolean LOG_ENABLED = LOGGER.isLoggable(Level.FINER); if (LOG_ENABLED) { LOGGER.finer("updateEntries() " + this); // NOI18N } ChildrenAdapter cha = nodeL; if (cha != null) { final int count = origSupport.getNodesCount(false); Children.MUTEX.postWriteRequest(new Runnable() { @Override public void run() { updateEntries(count); } }); } }
final Node switchToOriginal() { final Node[] n = new Node[]{null}; synchronized (this) { if (map == null) { return getOriginal(); } n[0] = (Node)map.get("original"); // NOI18N if (n[0] == null) { throw new IllegalArgumentException("Original Node from map " + map + " is null"); } map = null; } Children.MUTEX.postWriteRequest(new Runnable() { public void run() { changeOriginal(n[0], true); } }); return n[0]; }
Children.MUTEX.postWriteRequest(new Runnable() { public void run() {
Children.MUTEX.postWriteRequest(setAndNotify); } else { setAndNotify.run();
Children.MUTEX.postWriteRequest(notify); } else { notify.run();
public void update() { Children.MUTEX.postWriteRequest(new Runnable() { public void run() { changeOriginal(createNodeDelegateImpl(), true); } }); } }
/** This method can be called by subclasses that * directly modify the nodes collection to update the * state of the nodes appropriatelly. */ protected final void refresh () { MUTEX.postWriteRequest (new Runnable () { public void run () { refreshImpl (); } }); }
/** Refresh the child nodes for a given key. * * @param key the key to refresh */ protected final void refreshKey (final Object key) { MUTEX.postWriteRequest (new Runnable () { public void run () { Keys.this.refreshEntry (new KE (key)); } }); }
/** This method can be called by subclasses that * directly modify the nodes collection to update the * state of the nodes appropriatelly. */ protected final void refresh () { MUTEX.postWriteRequest (new Runnable () { public void run () { refreshImpl (); } }); }
/** Refresh the child nodes for a given key. * * @param key the key to refresh */ protected final void refreshKey (final Object key) { MUTEX.postWriteRequest (new Runnable () { public void run () { Keys.this.refreshEntry (new KE (key)); } }); }
@Override public void run() { ProjectManager.mutex().postWriteRequest(r); } });
@Override public void postWriteRequest(Runnable run) { owner.MUTEX.postWriteRequest(wrap(run)); }
private void updateJ2EESpec(final Project project, final AntProjectHelper helper, final Profile j2eeProfile) { ProjectManager.mutex().postWriteRequest(new Runnable() { @Override public void run() { try { EditableProperties projectProps = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); projectProps.put("j2ee.platform", j2eeProfile.toPropertiesString()); helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, projectProps); ProjectManager.getDefault().saveProject(project); } catch (IOException e) { Exceptions.printStackTrace(e); } } }); }
/** Applies the keys. */ private void applyKeys (final ArrayList l) { Runnable invoke = new Runnable () { public void run () { if (keysCheck (Keys.this, this)) { // no next request after me Keys.this.setEntries (l); // clear this runnable keysExit (Keys.this, this); } } }; keysEnter (this, invoke); MUTEX.postWriteRequest (invoke); }