本文整理匯總了Java中org.eclipse.nebula.widgets.nattable.coordinate.Range類的典型用法代碼示例。如果您正苦於以下問題:Java Range類的具體用法?Java Range怎麽用?Java Range使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Range類屬於org.eclipse.nebula.widgets.nattable.coordinate包,在下文中一共展示了Range類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSelectedRowPosition
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
public int getSelectedRowPosition() {
if (compositeLayer != null) {
SelectionLayer selectionLayer = compositeLayer.getSelectionLayer();
final Set<Range> selectedRows = selectionLayer.getSelectedRowPositions();
List<Integer> selectedRowPositions = new ArrayList<Integer>();
for (Range range : selectedRows) {
for (int rowPosition = range.start; rowPosition < range.end; rowPosition++) {
// + 1
selectedRowPositions.add(rowPosition + 1);
}
}
Collections.sort(selectedRowPositions);
// at this moment return only first
if (selectedRowPositions.size() > 0) {
return selectedRowPositions.get(0).intValue();
}
}
return -1;
}
示例2: getSelectedPathFixture
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
/**
* @param selections
* @return
*/
private PathFixture getSelectedPathFixture() {
PathFixture fixture = null;
Set<Range> selections = selectionLayer.getSelectedRowPositions();
if (log.isDebugEnabled()) {
log.debug("Selected Row: " + ObjectUtils.toString(selections)); //$NON-NLS-1$ �
}
for (Range r : selections) {
for (int i = r.start; i < r.end; i++) {
if (i > -1) {
// handle only first row object in range
fixture = bodyDataProvider.getRowObject(i);
break;
}
}
}
return fixture;
}
示例3: toRanges
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
private Range[] toRanges(final int[] columnIndices) {
final Range[] ranges = new Range[columnIndices.length];
for (int i = 0; i < columnIndices.length; i++) {
final int columnIndex = columnIndices[i];
ranges[i] = new Range(columnIndex, columnIndex + 1);
}
return ranges;
}
示例4: deleteRows
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
public void deleteRows(Set<Range> selections) {
if (relvarName == null) {
// TODO - implement this
System.out.println("Editor: deleteRows() for relvarName == null not implemented yet.");
} else {
String deleteQuery = "DELETE " + relvarName + " WHERE ";
String allKeysSpec = "";
int tupleCount = 0;
for (Range range : selections)
for (int rownum = range.start; rownum < range.end; rownum++) {
if (rows.get(rownum).getAction() != RowAction.INSERT) {
String keyspec = getKeySelectionExpression(rownum);
if (allKeysSpec.length() > 0)
allKeysSpec += " OR ";
allKeysSpec += "(" + keyspec + ")";
}
tupleCount++;
}
deleteQuery += allKeysSpec + ";";
System.out.println("RelvarEditor: query is " + deleteQuery);
ExecuteResult result = connection.execute(deleteQuery);
if (result.failed())
MessageDialog.openError(table.getShell(), "DELETE Error",
"Unable to delete tuple" + ((tupleCount > 1) ? "s" : "") + ".\n\nQuery: " + deleteQuery
+ " failed:\n\n" + result.getErrorMessage());
else
refresh();
}
}
示例5: getSelectedRowPositions
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
@Override
public Set<Range> getSelectedRowPositions() {
return Collections.emptySet();
}
示例6: doDeleteSelected
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
private void doDeleteSelected() {
Set<Range> selections = gridLayer.getBodyLayer().getSelectionLayer().getSelectedRowPositions();
dataProvider.deleteRows(selections);
}
示例7: doDeleteSelected
import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
private void doDeleteSelected() {
Set<Range> selections = gridLayer.getBodyLayer().getSelectionLayer().getSelectedRowPositions();
if (dataProvider != null)
dataProvider.deleteRows(selections);
}