当前位置: 首页>>代码示例>>Java>>正文


Java ObjectCloner类代码示例

本文整理汇总了Java中ro.nextreports.engine.util.ObjectCloner的典型用法代码示例。如果您正苦于以下问题:Java ObjectCloner类的具体用法?Java ObjectCloner怎么用?Java ObjectCloner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ObjectCloner类属于ro.nextreports.engine.util包,在下文中一共展示了ObjectCloner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
  	    	
  	// report was not saved and we do not know where to insert the subreport
  	if (Globals.getCurrentReportAbsolutePath() == null) {
  		if (!NextReportsUtil.saveReportForInserting(I18NSupport.getString("existing.report.report.save"))) {
  			return;
  		}
  	}
  	
  	ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

int row = selectionModel.getSelectedCell().getRow();
      int column = selectionModel.getSelectedCell().getColumn();

      Report defaultReport = new Report();
      defaultReport.setName(DEFAULT_TEXT);
      BandElement element = new ForReportBandElement(defaultReport);
      grid.putClientProperty("layoutBeforeInsert", ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout()));
      BandUtil.insertElement(element, row, column);

      grid.editCellAt(row, column, event);

  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:25,代码来源:InsertForReportAction.java

示例2: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
  	    	
  	// report was not saved and we do not know where to copy image
  	if (Globals.getCurrentReportAbsolutePath() == null) {
  		if (!NextReportsUtil.saveReportForInserting(I18NSupport.getString("existing.report.image.save"))) {
  			return;
  		}
  	}
  	
  	ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

int row = selectionModel.getSelectedCell().getRow();
      int column = selectionModel.getSelectedCell().getColumn();
      
      BandElement element = new BarcodeBandElement(BarcodeEAN.EAN13, DEFAULT_TEXT, false);
      grid.putClientProperty("layoutBeforeInsert", ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout()));
      BandUtil.insertElement(element, row, column);

      grid.editCellAt(row, column, event);

  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:23,代码来源:InsertBarcodeAction.java

示例3: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
  	    	
  	// report was not saved and we do not know where to copy image
  	if (Globals.getCurrentReportAbsolutePath() == null) {
  		if (!NextReportsUtil.saveReportForInserting(I18NSupport.getString("existing.report.image.save"))) {
  			return;
  		}
  	}
  	
  	ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

int row = selectionModel.getSelectedCell().getRow();
      int column = selectionModel.getSelectedCell().getColumn();

      BandElement element = new ImageBandElement(DEFAULT_TEXT);
      grid.putClientProperty("layoutBeforeInsert", ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout()));
      BandUtil.insertElement(element, row, column);

      grid.editCellAt(row, column, event);

  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:23,代码来源:InsertImageAction.java

示例4: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
  	    	
  	// report was not saved and we do not know where to copy image
  	if (Globals.getCurrentReportAbsolutePath() == null) {
  		if (!NextReportsUtil.saveReportForInserting(I18NSupport.getString("existing.report.image.save"))) {
  			return;
  		}
  	}
  	
  	ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

int row = selectionModel.getSelectedCell().getRow();
      int column = selectionModel.getSelectedCell().getColumn();

      Chart defaultChart = new Chart();
      defaultChart.setName(DEFAULT_TEXT);
      BandElement element = new ChartBandElement(defaultChart);
      grid.putClientProperty("layoutBeforeInsert", ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout()));
      BandUtil.insertElement(element, row, column);

      grid.editCellAt(row, column, event);

  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:25,代码来源:InsertChartAction.java

示例5: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {

        ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());

        ReportGrid grid = Globals.getReportGrid();
		SelectionModel selectionModel = grid.getSelectionModel();
        DefaultSpanModel spanModel = (DefaultSpanModel) grid.getSpanModel();

        List<Cell> cells = selectionModel.getSelectedCells();
        for (Cell cell : cells) {
            CellSpan cellSpan = grid.getSpanModel().getSpanOver(cell.getRow(), cell.getColumn());
            spanModel.removeSpan(cellSpan);

            BandElement bandElement = grid.getBandElement(cell);
            if (bandElement != null) {
                bandElement.setRowSpan(1);
                bandElement.setColSpan(1);
            } else {
            	BandUtil.deleteElement(cell.getRow(), cell.getColumn());
            }
        }

        ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
        Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("unmerge.action.name")));

    }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:27,代码来源:UnmergeCellsAction.java

示例6: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
  	    	
  	// report was not saved and we do not know where to insert the subreport
  	if (Globals.getCurrentReportAbsolutePath() == null) {
  		if (!NextReportsUtil.saveReportForInserting(I18NSupport.getString("existing.report.report.save"))) {
  			return;
  		}
  	}
  	
  	ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

int row = selectionModel.getSelectedCell().getRow();
      int column = selectionModel.getSelectedCell().getColumn();

      Report defaultReport = new Report();
      defaultReport.setName(DEFAULT_TEXT);
      BandElement element = new ReportBandElement(defaultReport);
      grid.putClientProperty("layoutBeforeInsert", ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout()));
      BandUtil.insertElement(element, row, column);

      grid.editCellAt(row, column, event);

  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:25,代码来源:InsertReportAction.java

示例7: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {

        ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());

        ReportGrid grid = Globals.getReportGrid();
		SelectionModel selectionModel = grid.getSelectionModel();
		
		List<Cell> cells = selectionModel.getSelectedCells();
		for (Cell cell : cells) {
			if (grid.getBandElement(cell) != null) {
				BandUtil.deleteElement(cell.getRow(), cell.getColumn());
			}
            if (clearFirstCell) {
                break;
            }
        }

        ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
        Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("clear.cell.action.name")));
    }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:21,代码来源:ClearCellAction.java

示例8: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
      ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

int row = selectionModel.getSelectedCell().getRow();
      int column = selectionModel.getSelectedCell().getColumn();

      BandElement element = new ExpressionBandElement("", "");
      BandUtil.copySettings(grid.getBandElement(selectionModel.getSelectedCell()), element);
      
      grid.putClientProperty("layoutBeforeInsert", ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout()));
      BandUtil.insertElement(element, row, column);

      ExpressionCellEditor editor = (ExpressionCellEditor)grid.getCellEditor(row, column);
      editor.setStatic(isStatic);
      editor.setIsHeaderOrFooter(isHeaderOrFooter);
      editor.setBandName(BandUtil.getBand(LayoutHelper.getReportLayout(), selectionModel.getSelectedCell().getRow()).getName());
      grid.editCellAt(row, column, event);
  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:20,代码来源:InsertExpressionAction.java

示例9: DataSourcePanel

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public DataSourcePanel(String id, final String parentPath, DataSource dataSource) {
    super(id);

    this.parentPath = parentPath;

    this.dataSource = ObjectCloner.silenceDeepCopy(dataSource);
    if (dataSource.getName() != null) {
        this.modify = true;
    }

    AdvancedForm<DataSource> form = new DataSourceForm("form");

    NextFeedbackPanel feedbackPanel = new NextFeedbackPanel("feedback", form);
    feedbackPanel.setOutputMarkupId(true);
    feedbackPanel.setEscapeModelStrings(false);
    form.add(feedbackPanel);

    add(form);        

    setOutputMarkupId(true);
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:22,代码来源:DataSourcePanel.java

示例10: executeAction

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void executeAction(AjaxRequestTarget target) {
    Entity entity = getActionContext().getEntity();
    try {                        
    	
    	Entity clonedEntity = ObjectCloner.silenceDeepCopy(entity);        	
        String cloneName = clonedEntity.getName() + "_clone";            
        clonedEntity.setName(cloneName);                        
        String id = storageService.addEntity(clonedEntity);
        
        SchedulerJob job =  (SchedulerJob)storageService.getEntityById(id);

        EntityBrowserPanel panel = findParent(EntityBrowserPanel.class);
        ScheduleWizard wizard = new ScheduleWizard("work", job);
        wizard.add(AttributeModifier.append("class", "wizardScheduler"));
        panel.forwardWorkspace(wizard  , target);
        
        //setResponsePage(new ScheduleWizardPage(job));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:22,代码来源:CloneActionLink.java

示例11: getOldLayout

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
protected ReportLayout getOldLayout() {
      // get the variable shared with the insert text action
ReportLayout layoutBeforeInsert = getLayoutBeforeInsert();

ReportLayout oldLayout;
if (layoutBeforeInsert == null) {
	oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
} else {
	oldLayout = layoutBeforeInsert;
}
      return oldLayout;
  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:13,代码来源:DefaultGridCellEditor.java

示例12: registerUndoRedo

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
protected void registerUndoRedo(ReportLayout oldLayout, String editPresentationName, String insertPresentationName) {
    ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
    if (getLayoutBeforeInsert() == null) {
    	Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, editPresentationName));
    } else {
    	Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, insertPresentationName));
    }

    // reset the variable shared with the insert text action
    grid.putClientProperty("layoutBeforeInsert", null);
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:12,代码来源:DefaultGridCellEditor.java

示例13: cloneParameter

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
private void cloneParameter() {
	int[] selectedRows = table.getSelectedRows();
	if (selectedRows.length != 1) {
		Show.info(I18NSupport.getString("parameter.select"));
		return;
	}

	QueryParameter oldParam = (QueryParameter) model.getObjectForRow(selectedRows[0]);
	QueryParameter clone = ObjectCloner.silenceDeepCopy(oldParam);	
	clone.setName(clone.getName() + "_c");

	ParameterManager.getInstance().addParameter(clone);
	model.addObject(clone);
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:15,代码来源:ParametersPanel.java

示例14: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {

        if (!silent) {
            int option = JOptionPane.showConfirmDialog(Globals.getMainFrame(),
                    I18NSupport.getString("clear.all.action.message"),
                    I18NSupport.getString("clear.all.action.name"),
                    JOptionPane.YES_NO_OPTION);
            if (option != JOptionPane.YES_OPTION) {
                return;
            }
        }

        ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
        ReportLayout newLayout = null;

        Globals.getReportGrid().getSelectionModel().clearSelection();
        DefaultGridModel gridModel = (DefaultGridModel)Globals.getReportGrid().getModel();

        gridModel.removeRows(0, Globals.getReportLayoutPanel().getReportGridPanel().getRowCount());
        gridModel.removeColumns(0, Globals.getReportLayoutPanel().getReportGridPanel().getColumnCount());
        Globals.getReportLayoutPanel().getReportGridPanel().repaintHeaders();

        Globals.getReportGrid().emptyBandLocations();

        List<ReportGroup> groups = LayoutHelper.getReportLayout().getGroups();
        if (groups != null) {
            for (ReportGroup group : groups) {
                Globals.getReportDesignerPanel().getStructurePanel().deleteGroup(group.getName());
            }
            GroupIndexGenerator.resetCurrentIndex();
        }

        LayoutHelper.reset();

        if (!silent) {
            Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("edit.clear")));
        }

    }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:40,代码来源:ClearLayoutAction.java

示例15: actionPerformed

import ro.nextreports.engine.util.ObjectCloner; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
  	ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();

List<Cell> cells = selectionModel.getSelectedCells();
      int result = MergeAlgorithm.isPossible(cells);
      if (result == MergeAlgorithm.VALID) {

          ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());

          int firstRow = cells.get(0).getRow();
	int firstColumn = cells.get(0).getColumn();
	int lastRow = cells.get(cells.size() - 1).getRow();
	int lastColumn = cells.get(cells.size() - 1).getColumn();
	CellSpan cellSpan = new CellSpan(firstRow, firstColumn,
			(lastRow - firstRow + 1), (lastColumn - firstColumn + 1));
	
	DefaultSpanModel spanModel = (DefaultSpanModel) grid.getSpanModel();
	spanModel.addSpan(cellSpan);

          BandUtil.moveNotEmptyBandElementToTopLeft(cellSpan);
          BandUtil.updateBandElement(cellSpan);
          
          for (int i=firstRow; i<=lastRow; i++) {
          	for (int j=firstColumn; j<=lastColumn; j++) {
          		if ((i == firstRow) && (j == firstColumn)) {
          			continue;
          		}
          		BandUtil.nullifyElement(i, j);
          	}
          }

          ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
          Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("merge.action.name")));
      } else {
	Show.info(I18NSupport.getString("merge.action.invalid") + " : " + message(result));
}
  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:39,代码来源:MergeCellsAction.java


注:本文中的ro.nextreports.engine.util.ObjectCloner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。