001: /*
002: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
007: *
008: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
009: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
010: * the license for the specific language governing your rights and limitations.
011: *
012: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
013: */
014: package org.pentaho.reportdesigner.crm.report.datasetplugin;
015:
016: import org.jetbrains.annotations.NotNull;
017: import org.jetbrains.annotations.Nullable;
018: import org.pentaho.reportdesigner.crm.report.IconLoader;
019: import org.pentaho.reportdesigner.crm.report.datasetplugin.staticfactory.StaticFactoryDataSetReportElement;
020: import org.pentaho.reportdesigner.crm.report.model.ReportElement;
021: import org.pentaho.reportdesigner.crm.report.model.dataset.TableModelDataSetReportElement;
022: import org.pentaho.reportdesigner.crm.report.wizard.AbstractWizardPage;
023: import org.pentaho.reportdesigner.crm.report.wizard.WizardData;
024: import org.pentaho.reportdesigner.lib.client.i18n.TranslationManager;
025:
026: import javax.swing.*;
027: import java.util.HashMap;
028:
029: /**
030: * User: Martin
031: * Date: 27.02.2006
032: * Time: 10:00:41
033: */
034: public class StaticFactoryDataSetPlugin implements DataSetPlugin {
035:
036: public StaticFactoryDataSetPlugin() {
037: }
038:
039: @NotNull
040: public String getID() {
041: return "StaticFactoryDataSetPlugin";
042: }
043:
044: @NotNull
045: public String getLocalizedName() {
046: return TranslationManager.getInstance().getTranslation("R",
047: "StaticFactoryDataSetPlugin.Name");
048: }
049:
050: @NotNull
051: public String getLocalizedDescription() {
052: return TranslationManager.getInstance().getTranslation("R",
053: "StaticFactoryDataSetPlugin.Description");
054: }
055:
056: @NotNull
057: public ImageIcon getSmallIcon() {
058: return IconLoader.getInstance().getDataSetsIcon();
059: }
060:
061: public boolean isWizardable() {
062: return false;
063: }
064:
065: public void initWizardPages() {
066: }
067:
068: @Nullable
069: public AbstractWizardPage getFirstWizardPage() {
070: return null;
071: }
072:
073: @Nullable
074: public AbstractWizardPage getLastWizardPage() {
075: return null;
076: }
077:
078: @NotNull
079: public WizardData[] getInitialWizardDatas() {
080: return WizardData.EMPTY_ARRAY;
081: }
082:
083: @NotNull
084: public TableModelDataSetReportElement createDataSet(@NotNull
085: HashMap<String, WizardData> wizardDatas) {
086: return new StaticFactoryDataSetReportElement();
087: }
088:
089: public boolean canRead(@Nullable
090: String classname) {
091: return "org.pentaho.reportdesigner.crm.report.datasetplugin.staticfactory.StaticFactoryDataSetReportElement"
092: .equals(classname);
093: }
094:
095: @NotNull
096: public ReportElement createEmptyInstance(@NotNull
097: String className) {
098: return new StaticFactoryDataSetReportElement();
099: }
100: }
|