当前位置: 首页>>代码示例>>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;未经允许,请勿转载。