X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FSWTConstantInput.java;h=93babeac579d79c91f03145c4bf81aebe77b8689;hp=2f461b024660f6b98b4132750cc4dd14bf83f62c;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/SWTConstantInput.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/SWTConstantInput.java index 2f461b024..93babeac5 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/SWTConstantInput.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/SWTConstantInput.java @@ -1,54 +1,54 @@ -/******************************************************************************* - * Copyright (c) 2012 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.browsing.ui.swt; - -import java.util.Collections; -import java.util.Map; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.simantics.browsing.ui.common.ColumnKeys; -import org.simantics.browsing.ui.common.node.ConstantInput; - -final public class SWTConstantInput extends ConstantInput { - - final private static Map NO_IMAGES = Collections.emptyMap(); - - public SWTConstantInput(Map labels, Map imageDescriptors, int category) { - super(labels, imageDescriptors, category); - } - - public static SWTConstantInput create(String label) { - return new SWTConstantInput(Collections.singletonMap(ColumnKeys.SINGLE, label), NO_IMAGES, 0); - } - - public static SWTConstantInput create(String label, ImageDescriptor descriptor) { - return new SWTConstantInput(Collections.singletonMap(ColumnKeys.SINGLE, label), Collections.singletonMap(ColumnKeys.SINGLE, descriptor), 0); - } - - @Override - public int hashCode() { - return labels.hashCode() + 31 * imageDescriptors.hashCode() + 41 * category; - } - - @Override - public boolean equals(Object object) { - if (this == object) - return true; - else if (object == null) - return false; - else if (SWTConstantInput.class != object.getClass()) - return false; - SWTConstantInput r = (SWTConstantInput)object; - return r.labels.equals(labels) && r.imageDescriptors.equals(imageDescriptors) && r.category == category; - } - -} +/******************************************************************************* + * Copyright (c) 2012 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.browsing.ui.swt; + +import java.util.Collections; +import java.util.Map; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.simantics.browsing.ui.common.ColumnKeys; +import org.simantics.browsing.ui.common.node.ConstantInput; + +final public class SWTConstantInput extends ConstantInput { + + final private static Map NO_IMAGES = Collections.emptyMap(); + + public SWTConstantInput(Map labels, Map imageDescriptors, int category) { + super(labels, imageDescriptors, category); + } + + public static SWTConstantInput create(String label) { + return new SWTConstantInput(Collections.singletonMap(ColumnKeys.SINGLE, label), NO_IMAGES, 0); + } + + public static SWTConstantInput create(String label, ImageDescriptor descriptor) { + return new SWTConstantInput(Collections.singletonMap(ColumnKeys.SINGLE, label), Collections.singletonMap(ColumnKeys.SINGLE, descriptor), 0); + } + + @Override + public int hashCode() { + return labels.hashCode() + 31 * imageDescriptors.hashCode() + 41 * category; + } + + @Override + public boolean equals(Object object) { + if (this == object) + return true; + else if (object == null) + return false; + else if (SWTConstantInput.class != object.getClass()) + return false; + SWTConstantInput r = (SWTConstantInput)object; + return r.labels.equals(labels) && r.imageDescriptors.equals(imageDescriptors) && r.category == category; + } + +}