當前位置: 首頁>>代碼示例>>Java>>正文


Java Range類代碼示例

本文整理匯總了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;
}
 
開發者ID:e4c,項目名稱:EclipseCommander,代碼行數:22,代碼來源:PathNatTable.java

示例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;
}
 
開發者ID:e4c,項目名稱:EclipseCommander,代碼行數:24,代碼來源:OpenPathHandler.java

示例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;
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:9,代碼來源:NatTableImplSpi.java

示例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();
	}
}
 
開發者ID:DaveVoorhis,項目名稱:Rel,代碼行數:33,代碼來源:Editor.java

示例5: getSelectedRowPositions

import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
@Override
public Set<Range> getSelectedRowPositions() {
	return Collections.emptySet();
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:5,代碼來源:NoSelectionRowSelectionModel.java

示例6: doDeleteSelected

import org.eclipse.nebula.widgets.nattable.coordinate.Range; //導入依賴的package包/類
private void doDeleteSelected() {
	Set<Range> selections = gridLayer.getBodyLayer().getSelectionLayer().getSelectedRowPositions();
	dataProvider.deleteRows(selections);
}
 
開發者ID:DaveVoorhis,項目名稱:Rel,代碼行數:5,代碼來源:Designer.java

示例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);
}
 
開發者ID:DaveVoorhis,項目名稱:Rel,代碼行數:6,代碼來源:Editor.java


注:本文中的org.eclipse.nebula.widgets.nattable.coordinate.Range類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。