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


Java HSSFWorkbook.getSheetName方法代碼示例

本文整理匯總了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getSheetName方法的典型用法代碼示例。如果您正苦於以下問題:Java HSSFWorkbook.getSheetName方法的具體用法?Java HSSFWorkbook.getSheetName怎麽用?Java HSSFWorkbook.getSheetName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.poi.hssf.usermodel.HSSFWorkbook的用法示例。


在下文中一共展示了HSSFWorkbook.getSheetName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: countSheetFromTemplate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
private int countSheetFromTemplate(final HSSFWorkbook workbook, final ERDiagram diagram) {
    int count = 0;

    for (int sheetNo = 0; sheetNo < workbook.getNumberOfSheets(); sheetNo++) {
        final String templateSheetName = workbook.getSheetName(sheetNo);

        final AbstractSheetGenerator sheetGenerator = getSheetGenerator(templateSheetName);

        if (sheetGenerator != null) {
            count += sheetGenerator.count(diagram);

        } else {
            count++;
        }
    }

    if (exportExcelSetting.isPutERDiagramOnExcel()) {
        count += 1;
    }

    return count;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:23,代碼來源:ExportToExcelManager.java

示例2: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {

    for (final Trigger trigger : diagram.getDiagramContents().getTriggerSet()) {
        final String name = trigger.getName();
        final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name, sheetNameMap);

        final String sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
        monitor.subTaskWithCounter("[Trigger] " + sheetName);

        sheetObjectMap.put(sheetName, trigger);

        setTriggerData(workbook, newSheet, trigger);
        monitor.worked(1);
    }
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:17,代碼來源:TriggerSheetGenerator.java

示例3: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {

    for (final Sequence sequence : diagram.getDiagramContents().getSequenceSet()) {
        final String name = sequence.getName();

        final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name, sheetNameMap);

        final String sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
        monitor.subTaskWithCounter("[Sequence] " + sheetName);

        sheetObjectMap.put(sheetName, sequence);

        setSequenceData(workbook, newSheet, sequence, diagram);
        monitor.worked(1);
    }
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:18,代碼來源:SequenceSheetGenerator.java

示例4: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {
    clear();

    for (final ERTable table : diagram.getDiagramContents().getContents().getTableSet()) {
        if (diagram.getCurrentCategory() != null && !diagram.getCurrentCategory().contains(table)) {
            continue;
        }

        for (final Index index : table.getIndexes()) {
            final String name = index.getName();

            final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name, sheetNameMap);

            final String sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
            monitor.subTaskWithCounter("[Index] " + sheetName);

            sheetObjectMap.put(sheetName, index);

            setIndexData(workbook, newSheet, index);
            monitor.worked(1);
        }
    }
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:25,代碼來源:IndexSheetGenerator.java

示例5: countSheetFromTemplate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
private int countSheetFromTemplate(HSSFWorkbook workbook, ERDiagram diagram) {
	int count = 0;

	for (int sheetNo = 0; sheetNo < workbook.getNumberOfSheets(); sheetNo++) {
		String templateSheetName = workbook.getSheetName(sheetNo);

		AbstractSheetGenerator sheetGenerator = this
				.getSheetGenerator(templateSheetName);

		if (sheetGenerator != null) {
			count += sheetGenerator.count(diagram);

		} else {
			count++;
		}
	}

	if (this.exportExcelSetting.isPutERDiagramOnExcel()) {
		count += 1;
	}

	return count;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:24,代碼來源:ExportToExcelManager.java

示例6: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {

	for (Trigger trigger : diagram.getDiagramContents().getTriggerSet()) {
		String name = trigger.getName();
		HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name,
				sheetNameMap);

		String sheetName = workbook.getSheetName(workbook
				.getSheetIndex(newSheet));
		monitor.subTaskWithCounter("[Trigger] " + sheetName);

		sheetObjectMap.put(sheetName, trigger);

		this.setTriggerData(workbook, newSheet, trigger);
		monitor.worked(1);
	}
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:24,代碼來源:TriggerSheetGenerator.java

示例7: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {

	for (Sequence sequence : diagram.getDiagramContents().getSequenceSet()) {
		String name = sequence.getName();

		HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name,
				sheetNameMap);

		String sheetName = workbook.getSheetName(workbook
				.getSheetIndex(newSheet));
		monitor.subTaskWithCounter("[Sequence] " + sheetName);

		sheetObjectMap.put(sheetName, sequence);

		this.setSequenceData(workbook, newSheet, sequence, diagram);
		monitor.worked(1);
	}
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:25,代碼來源:SequenceSheetGenerator.java

示例8: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {

	String sheetName = this.getSheetName();

	HSSFSheet newSheet = createNewSheet(workbook, sheetNo, sheetName,
			sheetNameMap);

	sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
	monitor.subTaskWithCounter(sheetName);

	sheetObjectMap.put(sheetName, new StringObjectModel(sheetName));

	this.setHistoryListData(workbook, newSheet, sheetObjectMap, diagram);
	monitor.worked(1);
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:25,代碼來源:HistorySheetGenerator.java

示例9: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {
	String name = this.getSheetName();
	HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name,
			sheetNameMap);

	String sheetName = workbook.getSheetName(workbook
			.getSheetIndex(newSheet));

	sheetObjectMap.put(sheetName, new ColumnSet());

	this.setAllColumnsData(monitor, workbook, newSheet, diagram);
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:19,代碼來源:ColumnSheetGenerator.java

示例10: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {
    clear();

    List<ERTable> nodeSet = null;

    if (diagram.getCurrentCategory() != null) {
        nodeSet = diagram.getCurrentCategory().getTableContents();
    } else {
        nodeSet = diagram.getDiagramContents().getContents().getTableSet().getList();
    }

    for (final ERTable table : nodeSet) {
        String name = null;
        if (useLogicalNameAsSheetName) {
            name = table.getLogicalName();
        } else {
            name = table.getPhysicalName();
        }

        final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name, sheetNameMap);

        final String sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
        monitor.subTaskWithCounter("[Table] " + sheetName);

        sheetObjectMap.put(sheetName, table);

        setTableData(workbook, newSheet, table);

        monitor.worked(1);
    }
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:36,代碼來源:TableSheetGenerator.java

示例11: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {
    clear();

    List<View> nodeSet = null;

    if (diagram.getCurrentCategory() != null) {
        nodeSet = diagram.getCurrentCategory().getViewContents();
    } else {
        nodeSet = diagram.getDiagramContents().getContents().getViewSet().getList();
    }

    for (final View view : nodeSet) {
        String name = null;
        if (useLogicalNameAsSheetName) {
            name = view.getLogicalName();
        } else {
            name = view.getPhysicalName();
        }

        final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name, sheetNameMap);

        final String sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));
        monitor.subTaskWithCounter("[View] " + sheetName);

        sheetObjectMap.put(sheetName, view);

        setViewData(workbook, newSheet, view);

        monitor.worked(1);
    }
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:33,代碼來源:ViewSheetGenerator.java

示例12: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(final ProgressMonitor monitor, final HSSFWorkbook workbook, final int sheetNo, final boolean useLogicalNameAsSheetName, final Map<String, Integer> sheetNameMap, final Map<String, ObjectModel> sheetObjectMap, final ERDiagram diagram, final Map<String, LoopDefinition> loopDefinitionMap) throws InterruptedException {
    final String name = getSheetName();
    final HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name, sheetNameMap);

    final String sheetName = workbook.getSheetName(workbook.getSheetIndex(newSheet));

    sheetObjectMap.put(sheetName, new ColumnSet());

    setAllColumnsData(monitor, workbook, newSheet, diagram);
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:12,代碼來源:ColumnSheetGenerator.java

示例13: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {
	this.clear();

	List<ERTable> nodeSet = null;

	if (diagram.getCurrentCategory() != null) {
		nodeSet = diagram.getCurrentCategory().getTableContents();
	} else {
		nodeSet = diagram.getDiagramContents().getContents().getTableSet()
				.getList();
	}

	for (ERTable table : nodeSet) {
		String name = null;
		if (useLogicalNameAsSheetName) {
			name = table.getLogicalName();
		} else {
			name = table.getPhysicalName();
		}

		HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name,
				sheetNameMap);

		String sheetName = workbook.getSheetName(workbook
				.getSheetIndex(newSheet));
		monitor.subTaskWithCounter("[Table] " + sheetName);

		sheetObjectMap.put(sheetName, table);

		this.setTableData(workbook, newSheet, table);

		monitor.worked(1);
	}
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:44,代碼來源:TableSheetGenerator.java

示例14: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {
	this.clear();

	List<View> nodeSet = null;

	if (diagram.getCurrentCategory() != null) {
		nodeSet = diagram.getCurrentCategory().getViewContents();
	} else {
		nodeSet = diagram.getDiagramContents().getContents().getViewSet()
				.getList();
	}

	for (View view : nodeSet) {
		String name = null;
		if (useLogicalNameAsSheetName) {
			name = view.getLogicalName();
		} else {
			name = view.getPhysicalName();
		}

		HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name,
				sheetNameMap);

		String sheetName = workbook.getSheetName(workbook
				.getSheetIndex(newSheet));
		monitor.subTaskWithCounter("[View] " + sheetName);

		sheetObjectMap.put(sheetName, view);

		this.setViewData(workbook, newSheet, view);

		monitor.worked(1);
	}
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:41,代碼來源:ViewSheetGenerator.java

示例15: generate

import org.apache.poi.hssf.usermodel.HSSFWorkbook; //導入方法依賴的package包/類
@Override
public void generate(ProgressMonitor monitor, HSSFWorkbook workbook,
		int sheetNo, boolean useLogicalNameAsSheetName,
		Map<String, Integer> sheetNameMap,
		Map<String, ObjectModel> sheetObjectMap, ERDiagram diagram,
		Map<String, LoopDefinition> loopDefinitionMap)
		throws InterruptedException {
	this.clear();

	for (ERTable table : diagram.getDiagramContents().getContents()
			.getTableSet()) {
		if (diagram.getCurrentCategory() != null
				&& !diagram.getCurrentCategory().contains(table)) {
			continue;
		}

		for (Index index : table.getIndexes()) {
			String name = index.getName();

			HSSFSheet newSheet = createNewSheet(workbook, sheetNo, name,
					sheetNameMap);

			String sheetName = workbook.getSheetName(workbook
					.getSheetIndex(newSheet));
			monitor.subTaskWithCounter("[Index] " + sheetName);

			sheetObjectMap.put(sheetName, index);

			this.setIndexData(workbook, newSheet, index);
			monitor.worked(1);
		}
	}
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:34,代碼來源:IndexSheetGenerator.java


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