X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2FExplorerState.java;h=b7d152c99ce30b2a99e25d849d2f1ca75727089c;hp=ea513a0bc73faf2a927780ab34975d09f1b63f41;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/ExplorerState.java b/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/ExplorerState.java index ea513a0bc..b7d152c99 100644 --- a/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/ExplorerState.java +++ b/bundles/org.simantics.browsing.ui/src/org/simantics/browsing/ui/ExplorerState.java @@ -1,82 +1,82 @@ -/******************************************************************************* - * Copyright (c) 2013 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Semantum Oy - initial API and implementation - *******************************************************************************/ -package org.simantics.browsing.ui; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; - -/** - * @author Tuukka Lehtonen - */ -public class ExplorerState { - - /** - * Default value for empty {@link #topNodePathChildIndex}. - */ - private static final int[] NO_CHILD_INDEXES = {}; - - /** - * Empty default value for ExplorerState. - */ - public static final ExplorerState EMPTY = new ExplorerState( - NodeContext.NONE, NO_CHILD_INDEXES, - Collections. emptyList(), - Collections. emptyMap()); - - /** - * An empty array of no top node path is set. - * @see NodeContext#NONE - */ - public final NodeContext[] topNodePath; - - /** - * Tells the child index of each node in {@link #topNodePath}. - * Must be the same size as {@link #topNodePath}. - */ - public final int[] topNodePathChildIndex; - - /** - * All the expanded nodes in the explorer. Never null. - */ - public final Collection expandedNodes; - - /** - * Widths of columns. - */ - public final Map columnWidths; - - /** - * @param topNodePath - * @param topNodePathChildIndex - * @param expandedNodes - * @param columnWidths - */ - public ExplorerState(NodeContext[] topNodePath, int[] topNodePathChildIndex, Collection expandedNodes, Map columnWidths) { - if (expandedNodes == null) - throw new IllegalArgumentException("null expanded nodes"); - this.topNodePath = topNodePath; - this.topNodePathChildIndex = topNodePathChildIndex; - this.expandedNodes = expandedNodes; - this.columnWidths = columnWidths; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "[topNodePath=" - + Arrays.toString(topNodePath) + ", topNodePathChildIndex=" - + Arrays.toString(topNodePathChildIndex) + ", expandedNodes=" - + expandedNodes + ", " + columnWidths + "]"; - } - -} +/******************************************************************************* + * Copyright (c) 2013 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package org.simantics.browsing.ui; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; + +/** + * @author Tuukka Lehtonen + */ +public class ExplorerState { + + /** + * Default value for empty {@link #topNodePathChildIndex}. + */ + private static final int[] NO_CHILD_INDEXES = {}; + + /** + * Empty default value for ExplorerState. + */ + public static final ExplorerState EMPTY = new ExplorerState( + NodeContext.NONE, NO_CHILD_INDEXES, + Collections. emptyList(), + Collections. emptyMap()); + + /** + * An empty array of no top node path is set. + * @see NodeContext#NONE + */ + public final NodeContext[] topNodePath; + + /** + * Tells the child index of each node in {@link #topNodePath}. + * Must be the same size as {@link #topNodePath}. + */ + public final int[] topNodePathChildIndex; + + /** + * All the expanded nodes in the explorer. Never null. + */ + public final Collection expandedNodes; + + /** + * Widths of columns. + */ + public final Map columnWidths; + + /** + * @param topNodePath + * @param topNodePathChildIndex + * @param expandedNodes + * @param columnWidths + */ + public ExplorerState(NodeContext[] topNodePath, int[] topNodePathChildIndex, Collection expandedNodes, Map columnWidths) { + if (expandedNodes == null) + throw new IllegalArgumentException("null expanded nodes"); + this.topNodePath = topNodePath; + this.topNodePathChildIndex = topNodePathChildIndex; + this.expandedNodes = expandedNodes; + this.columnWidths = columnWidths; + } + + @Override + public String toString() { + return getClass().getSimpleName() + "[topNodePath=" + + Arrays.toString(topNodePath) + ", topNodePathChildIndex=" + + Arrays.toString(topNodePathChildIndex) + ", expandedNodes=" + + expandedNodes + ", " + columnWidths + "]"; + } + +}