Author: adietish
Date: 2011-10-11 18:40:16 -0400 (Tue, 11 Oct 2011)
New Revision: 35561
Removed:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
Log:
[JBIDE-9793] corrected default behaviour of DataBindingUtils#bindEnablement (was: enabled
if the severity == IStatus.ERROR; now: severity == IStatus.OK)
Deleted:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java 2011-10-11
21:23:31 UTC (rev 35560)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java 2011-10-11
22:40:16 UTC (rev 35561)
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.ui.databinding;
-
-import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * Converts an IStatus to a boolean.
- *
- * @author André Dietisheim
- *
- * @see IStatus
- *
- */
-public class Status2BooleanConverter extends Converter {
-
- private int severity;
-
- public Status2BooleanConverter(int severity) {
- super(IStatus.class, Boolean.class);
- this.severity = severity;
- }
-
- /**
- * Compares the given IStatus to the status that was given at construction
- * time. Returns <code>true</code> if they're <b>not</b>
equal, <code>false</code>
- * otherwise.
- *
- * @see IStatus#ERROR
- * @see IStatus#WARNING
- * @see IStatus#INFO
- * @see IStatus#OK
- */
- public Object convert(Object fromObject) {
- if (!(fromObject instanceof IStatus)) {
- return Boolean.FALSE;
- }
-
- int current = ((IStatus) fromObject).getSeverity();
- if (current == IStatus.OK) {
- return severity == IStatus.OK;
- }
- return (severity | current) == severity;
- }
-}
\ No newline at end of file