use of com.biglybt.ui.common.table.TableCellCore in project BiglyBT by BiglySoftware.
the class FileHashItemBase method cellMouseTrigger.
@Override
public void cellMouseTrigger(TableCellMouseEvent event) {
DiskManagerFileInfo file = (DiskManagerFileInfo) event.cell.getDataSource();
if (file == null) {
return;
}
TableCellCore core_cell = (TableCellCore) event.cell;
if (!event.cell.getText().startsWith("<")) {
core_cell.setCursorID(SWT.CURSOR_ARROW);
core_cell.setToolTip(null);
return;
}
if (event.eventType == TableRowMouseEvent.EVENT_MOUSEENTER) {
core_cell.setCursorID(SWT.CURSOR_HAND);
core_cell.setToolTip(MessageText.getString("FilesView.click.info"));
} else if (event.eventType == TableRowMouseEvent.EVENT_MOUSEEXIT) {
core_cell.setCursorID(SWT.CURSOR_ARROW);
core_cell.setToolTip(null);
}
if (event.eventType != TableCellMouseEvent.EVENT_MOUSEUP) {
return;
}
if (event.button != 1) {
return;
}
event.skipCoreFunctionality = true;
updateHash(hash_type, file);
}
use of com.biglybt.ui.common.table.TableCellCore in project BiglyBT by BiglySoftware.
the class NameItem method cellMouseTrigger.
@Override
public void cellMouseTrigger(TableCellMouseEvent event) {
if (event.eventType == TableCellMouseEvent.EVENT_MOUSEMOVE || event.eventType == TableRowMouseEvent.EVENT_MOUSEDOWN) {
TableRow row = event.cell.getTableRow();
if (row == null) {
return;
}
boolean inArea = false;
Object data = row.getData(ID_EXPANDOHITAREA);
if (data instanceof Rectangle) {
Rectangle hitArea = (Rectangle) data;
boolean inExpando = hitArea.contains(event.x, event.y);
if (inExpando) {
inArea = true;
if (event.eventType == TableCellMouseEvent.EVENT_MOUSEDOWN) {
if (row instanceof TableRowCore) {
TableRowCore rowCore = (TableRowCore) row;
rowCore.setExpanded(!rowCore.isExpanded());
}
}
}
}
data = row.getData(ID_CHECKHITAREA);
if (data instanceof Rectangle) {
Rectangle hitArea = (Rectangle) data;
boolean inCheck = hitArea.contains(event.x, event.y);
if (inCheck) {
inArea = true;
if (event.eventType == TableCellMouseEvent.EVENT_MOUSEDOWN) {
if (row instanceof TableRowCore) {
TableRowCore rowCore = (TableRowCore) row;
if (rowCore != null) {
final DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) event.cell.getDataSource();
if (fileInfo instanceof FilesView.FilesViewTreeNode) {
FilesView.FilesViewTreeNode node = (FilesView.FilesViewTreeNode) fileInfo;
if (!node.isLeaf()) {
int old_skipped = node.getSkippedState();
boolean new_skipped;
if (old_skipped == 0) {
new_skipped = false;
} else if (old_skipped == 1) {
new_skipped = true;
} else {
new_skipped = true;
}
node.setSkipped(new_skipped);
return;
}
}
fileInfo.setSkipped(!fileInfo.isSkipped());
}
}
}
}
}
if (event.eventType == TableCellMouseEvent.EVENT_MOUSEMOVE) {
((TableCellCore) event.cell).setCursorID(inArea ? SWT.CURSOR_HAND : SWT.CURSOR_ARROW);
}
}
}
use of com.biglybt.ui.common.table.TableCellCore in project BiglyBT by BiglySoftware.
the class TableRowSWTBase method setShown.
/* (non-Javadoc)
* @see com.biglybt.ui.swt.views.table.TableRowSWT#setShown(boolean, boolean)
*/
@Override
public boolean setShown(boolean b, boolean force) {
if (bDisposed) {
return false;
}
if (b == wasShown && !force) {
return false;
}
wasShown = b;
Collection<TableCellCore> lTableCells = null;
synchronized (lock) {
if (mTableCells != null) {
lTableCells = new ArrayList<>(mTableCells.values());
}
}
if (lTableCells != null) {
for (TableCellCore cell : lTableCells) {
if (cell != null) {
cell.invokeVisibilityListeners(b ? TableCellVisibilityListener.VISIBILITY_SHOWN : TableCellVisibilityListener.VISIBILITY_HIDDEN, true);
}
}
}
return true;
/* Don't need to refresh; paintItem will trigger a refresh on
* !cell.isUpToDate()
*
if (b) {
refresh(b, true);
}
/**/
}
Aggregations