本文整理汇总了Java中ro.nextreports.engine.util.ObjectCloner.silenceDeepCopy方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectCloner.silenceDeepCopy方法的具体用法?Java ObjectCloner.silenceDeepCopy怎么用?Java ObjectCloner.silenceDeepCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ro.nextreports.engine.util.ObjectCloner
的用法示例。
在下文中一共展示了ObjectCloner.silenceDeepCopy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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")));
}
示例3: 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;
}
示例4: 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);
}
示例5: 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);
}
示例6: 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")));
}
}
示例7: 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));
}
}
示例8: actionPerformed
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent event) {
List<ReportGroup> groups = LayoutHelper.getReportLayout().getGroups();
if ((groups == null) || (groups.size() == 0)) {
return;
}
ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
SelectionGroupPanel panel = new SelectionGroupPanel(true);
BaseDialog dialog = new BaseDialog(panel, I18NSupport.getString("edit.group.action.name"), true);
dialog.pack();
dialog.setLocationRelativeTo(Globals.getMainFrame());
dialog.setVisible(true);
if (!dialog.okPressed()) {
return;
}
ReportGroup reportGroup = panel.getGroup();
String groupName = reportGroup.getName();
String oldGroupColumn = reportGroup.getColumn();
String groupColumn = panel.getGroupColumn();
boolean headerOnEveryPage = panel.onEveryPage();
boolean newPageAfter = panel.isNewPageAfter();
LayoutHelper.getReportLayout().editGroup(groupName, groupColumn, headerOnEveryPage, newPageAfter);
ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("edit.group.modify")));
}
示例9: actionPerformed
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent event) {
final NumberSelectionPanel panel = new NumberSelectionPanel(I18NSupport.getString("insert.column.number"));
final BaseDialog dialog = new BaseDialog(panel, I18NSupport.getString("insert.column.before.action.name"), true) {
public boolean okPressed() {
if ((panel.getNumber() < 1) || (panel.getNumber() > BandUtil.MAX)) {
Show.info(this, I18NSupport.getString("rowCol.max", BandUtil.MAX));
return false;
}
return super.okPressed();
}
};
dialog.pack();
dialog.setLocationRelativeTo(Globals.getMainFrame());
dialog.setVisible(true);
if (!dialog.okPressed()) {
return;
}
ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
int columnCount = panel.getNumber();
ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();
ReportGridPanel reportGridPanel = Globals.getReportLayoutPanel().getReportGridPanel();
Cell cell = CellUtil.getCellFromSelectedColumn(grid,selectedColumn);
for (int i = 0; i < columnCount; i++) {
reportGridPanel.insertColumns(cell.getRow(), cell.getColumn() + i, 1, false);
}
selectionModel.clearSelection();
// update column width array
ReportLayoutUtil.updateColumnWidth(Globals.getReportGrid());
ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("edit.column.insert.before")));
}
示例10: actionPerformed
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent event) {
final NumberSelectionPanel panel = new NumberSelectionPanel(I18NSupport.getString("insert.row.number"));
final BaseDialog dialog = new BaseDialog(panel, I18NSupport.getString("insert.row.after.action.name"), true) {
public boolean okPressed() {
if ((panel.getNumber() < 1) || (panel.getNumber() > BandUtil.MAX)) {
Show.info(this, I18NSupport.getString("rowCol.max", BandUtil.MAX));
return false;
}
return super.okPressed();
}
};
dialog.pack();
dialog.setLocationRelativeTo(Globals.getMainFrame());
dialog.setVisible(true);
if (!dialog.okPressed()) {
return;
}
ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
int rowCount = panel.getNumber();
ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();
ReportGridPanel reportGridPanel = Globals.getReportLayoutPanel().getReportGridPanel();
Cell cell = CellUtil.getCellFromSelectedRow(grid,selectedRow);
for (int i = 0; i < rowCount; i++) {
reportGridPanel.insertRows(cell.getRow() + i, cell.getColumn(), 1, true);
}
selectionModel.clearSelection();
ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("edit.row.insert.after")));
}
示例11: getCache
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
private List<RowData> getCache() throws NoDataFoundException, Exception {
if (cache == null) {
if (widgetId != null) {
TableData td = dashboardService.getTableData(widgetId, drillContext, urlQueryParameters);
// tableData may be kept in cache (if there are cache settings set)!
// so we must use a clone here to not modify the original in case of filtering
TableData tableData = ObjectCloner.silenceDeepCopy(td);
List<List<Object>> data = tableData.getData();
List<List<Map<String, Object>>> style = tableData.getStyle();
header = tableData.getHeader();
if (data != null) {
cache = new ArrayList<RowData>();
tableFilter = NextServerSession.get().getTableFilter(widgetId);
if (tableFilter == null) {
List<Object> cellValues = new ArrayList<Object>();
if (data.size() > 0) {
for (int k=0; k<data.get(0).size(); k++) {
cellValues.add(null);
}
}
tableFilter = new RowData(cellValues);
} else {
tableData.search(tableFilter.getCellValues());
}
for (int i=0, size=data.size(); i<size; i++) {
List<Object> row = data.get(i);
RowData rowData = new RowData(row);
if (i == 0) {
pattern = tableData.getPattern();
language = tableData.getLanguage();
}
rowData.setStyles(style.get(i));
cache.add(rowData);
}
}
}
}
return cache;
}
示例12: actionPerformed
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent event) {
final NumberSelectionPanel panel = new NumberSelectionPanel(I18NSupport.getString("insert.row.number"));
final BaseDialog dialog = new BaseDialog(panel, I18NSupport.getString("insert.row.before.action.name"), true) {
public boolean okPressed() {
if ((panel.getNumber() < 1) || (panel.getNumber() > BandUtil.MAX)) {
Show.info(this, I18NSupport.getString("rowCol.max", BandUtil.MAX));
return false;
}
return super.okPressed();
}
};
dialog.pack();
dialog.setLocationRelativeTo(Globals.getMainFrame());
dialog.setVisible(true);
if (!dialog.okPressed()) {
return;
}
ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
int rowCount = panel.getNumber();
ReportGrid grid = Globals.getReportGrid();
SelectionModel selectionModel = grid.getSelectionModel();
ReportGridPanel reportGridPanel = Globals.getReportLayoutPanel().getReportGridPanel();
Cell cell = CellUtil.getCellFromSelectedRow(grid,selectedRow);
for (int i = 0; i < rowCount; i++) {
reportGridPanel.insertRows(cell.getRow() + i, cell.getColumn(), 1, false);
}
selectionModel.clearSelection();
ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("edit.row.insert.before")));
}
示例13: importSettings
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
private void importSettings() {
if (mo.getSettings() != null) {
Settings orig = storageService.getSettings();
Settings old = mo.getSettings();
Settings mx = ObjectCloner.silenceDeepCopy(old);
mx.setId(orig.getId());
storageService.modifyEntity(mx);
}
}
示例14: installDefaults
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
protected void installDefaults() {
Color defaultGridColor = UIManager.getColor("Table.gridColor");
Color defaultForegroundColor = UIManager.getColor("Table.foreground");
Color defaultBackgroundColor = UIManager.getColor("Table.background");
Border defaultBorder = UIManager.getBorder("Table.scrollPaneBorder");
Color defaultSelectionForeground = UIManager
.getColor("Table.selectionForeground");
Color defaultSelectionBackground = UIManager
.getColor("Table.selectionBackground");
Color defaultFocusCellForeground = UIManager
.getColor("Table.focusCellForeground");
Color defaultFocusCellBackground = new Color(153, 153, 204);
Font defaultFont = UIManager.getFont("Table.font");
Border defaultGridBorder = UIManager.getBorder("Table.border");
InputMap inputMap = ObjectCloner.silenceDeepCopy((InputMap) UIManager.get("Table.ancestorInputMap"));
if (!installed) {
UIManager.getDefaults().put("Grid.gridColor", defaultGridColor);
UIManager.getDefaults().put("Grid.foreground",
defaultForegroundColor);
UIManager.getDefaults().put("Grid.background",
defaultBackgroundColor);
UIManager.getDefaults().put("Grid.selectionForegroundColor",
defaultSelectionForeground);
UIManager.getDefaults().put("Grid.selectionBackgroundColor",
defaultSelectionBackground);
UIManager.getDefaults().put("Grid.focusForegroundColor",
defaultFocusCellForeground);
UIManager.getDefaults().put("Grid.focusBackgroundColor",
defaultFocusCellBackground);
UIManager.getDefaults().put("Grid.border", defaultGridBorder);
UIManager.getDefaults().put("Grid.font", defaultFont);
UIManager.getDefaults().put("Grid.scrollPaneBorder", defaultBorder);
UIManager.getDefaults().put("Grid.ancestorInputMap", inputMap);
installed = true;
}
Color foregroundColor = grid.getForeground();
Color backgroundColor = grid.getBackground();
Font font = grid.getFont();
Border border = grid.getBorder();
Color gridColor = grid.getGridColor();
if (foregroundColor == null || foregroundColor instanceof UIResource) {
grid.setForeground(defaultForegroundColor);
}
if (backgroundColor == null || backgroundColor instanceof UIResource) {
grid.setBackground(defaultBackgroundColor);
}
if (font == null || font instanceof UIResource) {
grid.setFont(defaultFont);
}
if (gridColor == null || gridColor instanceof UIResource) {
grid.setGridColor(defaultGridColor);
}
if (border == null || border instanceof UIResource) {
grid.setBorder(defaultGridBorder);
}
}
示例15: actionPerformed
import ro.nextreports.engine.util.ObjectCloner; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
DefaultMutableTreeNode node;
TreePath path = structureTree.getSelectionPath();
node = (DefaultMutableTreeNode) path.getLastPathComponent();
if (e.getActionCommand().equals("insert")) {
final NumberSelectionPanel panel = new NumberSelectionPanel(I18NSupport.getString("insert.row.number"));
final BaseDialog dialog = new BaseDialog(panel, I18NSupport.getString("insert.row.after.action.name"), true) {
public boolean okPressed() {
if ((panel.getNumber() < 1) || (panel.getNumber() > BandUtil.MAX)) {
Show.info(this, I18NSupport.getString("rowCol.max", BandUtil.MAX));
return false;
}
return true;
}
};
dialog.pack();
dialog.setLocationRelativeTo(Globals.getMainFrame());
dialog.setVisible(true);
if (!dialog.okPressed()) {
return;
}
ReportLayout oldLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
int rows = panel.getNumber();
String bandName = ((Band) node.getUserObject()).getName();
Band band = LayoutHelper.getReportLayout().getBand(bandName);
int row = Globals.getReportGrid().getBandLocation(bandName).getLastGridRow();
int cols = Globals.getReportGrid().getColumnCount();
if (cols == 0) {
// empty report : we will add one column
cols = 1;
}
for (int i = 0; i < rows; i++) {
Globals.getReportLayoutPanel().getReportGridPanel().insertRow(band);
for (int j=0; j<cols; j++) {
BandUtil.insertElement(new BandElement(""), row+i, j);
}
}
Globals.getReportGrid().getSelectionModel().clearSelection();
ReportLayout newLayout = ObjectCloner.silenceDeepCopy(LayoutHelper.getReportLayout());
Globals.getReportUndoManager().addEdit(new LayoutEdit(oldLayout, newLayout, I18NSupport.getString("edit.row.insert.before")));
}
}