本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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")));
}
示例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);
}
示例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")));
}
示例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);
}
示例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);
}
示例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();
}
}
示例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;
}
示例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);
}
示例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);
}
示例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")));
}
}
示例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));
}
}