1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.diagram.symbollibrary.ui;
15 * @author Tuukka Lehtonen
17 class GroupFilter implements Comparable<GroupFilter> {
19 private String filterText;
20 private boolean active;
22 public GroupFilter(String name, String filterText, boolean active) {
24 assert filterText != null;
26 this.filterText = filterText;
30 public String getName() {
34 public void setName(String name) {
38 public String getFilterText() {
42 public void setFilterText(String filterText) {
43 this.filterText = filterText;
46 public boolean isActive() {
50 public void setActive(boolean active) {
55 public String toString() {
56 return getClass().getSimpleName() + "[" + name + ", filter=" + filterText + ", active=" + active + "]";
60 public int hashCode() {
63 result = prime * result + filterText.hashCode();
64 result = prime * result + name.hashCode();
69 public boolean equals(Object obj) {
74 if (!(obj instanceof GroupFilter))
76 GroupFilter other = (GroupFilter) obj;
77 if (!filterText.equals(other.filterText))
79 if (!name.equals(other.name))
85 public int compareTo(GroupFilter o) {
86 return name.compareToIgnoreCase(o.name);