List of usage examples for org.hibernate.envers.tools Pair make
public static <T1, T2> Pair<T1, T2> make(T1 obj1, T2 obj2)
From source file:edu.udo.scaffoldhunter.gui.ViewManager.java
License:Open Source License
/** * Removes a view, but does not remove the view state, fire any events * or call the view's destroy() method./*from w ww .j a va2s .c o m*/ * * @param view * * @return the window that contained the view, and the position the * view used to occupy */ private Pair<Window, ViewPosition> removeViewImpl(View view) { Preconditions.checkArgument(viewStates.containsKey(view)); Window window = getViewWindow(view); ViewPosition pos = getViewPosition(view); List<View> vs = views.get(window).get(pos.getSplit()); vs.remove(view); viewWindows.remove(view); return Pair.make(window, pos); }
From source file:edu.udo.scaffoldhunter.gui.ViewManagerConverter.java
License:Open Source License
/** * Deserializes a single tab./*from w w w . j a v a 2 s. co m*/ * * @param views * the map in which deserialized views are inserted * @param pos * the current view position * @param reader * @param context */ private void unmarshalTab(Map<ViewPosition, Pair<View, ViewExternalState>> views, ViewPosition pos, HierarchicalStreamReader reader, UnmarshallingContext context) { // try { View view = null; ViewExternalState externalState = null; while (reader.hasMoreChildren()) { reader.moveDown(); try { if (reader.getNodeName().equals("view")) { // deserialize the view itself view = (View) context.convertAnother(null, View.class); } else if (reader.getNodeName().equals("externalState")) { // deserialize the view's external state externalState = unmarshalViewExternalState(reader, context); } else { logger.debug("node '{}' not recognized", reader.getNodeName()); } } finally { reader.moveUp(); } } Pair<View, ViewExternalState> pair = Pair.make(view, externalState); views.put(new ViewPosition(pos), pair); ++pos.tab; // } // catch (Exception ex) { // logger.error("an error occured while restoring a view", ex); // } }