use of com.biglybt.ui.swt.utils.SWTRunnable in project BiglyBT by BiglySoftware.
the class TableViewPainted method removeAllTableRows.
@Override
public void removeAllTableRows() {
if (DEBUG_ROWCHANGE) {
debug("RemoveAlLRows");
}
super.removeAllTableRows();
synchronized (visibleRows_sync) {
visibleRows = new LinkedHashSet<>();
}
setFocusedRow(null);
totalHeight = 0;
Utils.execSWTThread(new SWTRunnable() {
@Override
public void runWithDisplay(Display display) {
if (cTable == null || cTable.isDisposed()) {
return;
}
swt_fixupSize();
swt_updateCanvasImage(false);
if (DEBUG_ROWCHANGE) {
debug("RemoveAllRows done");
}
}
});
}
use of com.biglybt.ui.swt.utils.SWTRunnable in project BiglyBT by BiglySoftware.
the class SideBarEntrySWT method close.
/* (non-Javadoc)
* @see BaseMdiEntry#close()
*/
@Override
public boolean close(boolean force) {
if (!super.close(force)) {
return false;
}
// remove immediately from MDI because disposal is on a delay
mdi.removeItem(SideBarEntrySWT.this);
// dispose will trigger dispose listener, which removed it from BaseMDI
Utils.execSWTThread(new SWTRunnable() {
@Override
public void runWithDisplay(Display display) {
if (swtItem != null && !swtItem.isDisposed()) {
try {
swtItem.setFont(null);
swtItem.dispose();
} catch (Exception e) {
// on OSX, SWT does some misguided exceptions on disposal of TreeItem
// We occasionally get SWTException of "Widget is Disposed" or
// "Argument not valid", as well as NPEs
Debug.outNoStack("Warning on SidebarEntry dispose: " + e.toString(), false);
} finally {
swtItem = null;
}
}
}
});
return true;
}
use of com.biglybt.ui.swt.utils.SWTRunnable in project BiglyBT by BiglySoftware.
the class TableCellSWTBase method setForeground.
private boolean setForeground(final RGB rgb) {
Color colorFG = getForegroundSWT();
boolean changed = colorFG == null || colorFG.isDisposed() || !colorFG.getRGB().equals(rgb);
if (changed) {
Utils.execSWTThread(new SWTRunnable() {
@Override
public void runWithDisplay(Display display) {
setForeground(ColorCache.getColor(Display.getCurrent(), rgb));
}
});
}
return changed;
}
Aggregations