/**********************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2012 IBM Corporation, Ericsson
* 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:
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ * Bernd Hufmann - Updated for TMF
**********************************************************************/
+
package org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs;
import java.util.ArrayList;
*/
protected boolean fStopSelected = false;
/**
- * The find expression.
+ * The find expression.
*/
protected String fExpression = null;
/**
- * The find pattern as regular expression.
+ * The find pattern as regular expression.
*/
protected Pattern pattern = null;
/**
* Copy constructor
- *
+ *
* @param other Criteria to create new criteria
*/
public Criteria (Criteria other) {
/**
* Returns true if the AsyncMessageReturn is selected, false otherwise.
- *
+ *
* @return true if the AsyncMessageReturn is selected, false otherwise
*/
public boolean isAsyncMessageReturnSelected() {
/**
* Returns true if the AsyncMessage is selected, false otherwise.
- *
+ *
* @return true if the AsyncMessage is selected, false otherwise
*/
public boolean isAsyncMessageSelected() {
/**
* Returns the text enter by the user.
- *
+ *
* @return the expression text
*/
public String getExpression() {
/**
* Returns the regular expression pattern.
- *
+ *
* @return the regular expression pattern
*/
public Pattern getPattern() {
return pattern;
}
-
+
/**
* Sets the regular expression pattern.
- *
- * @param the pattern to set
+ *
+ * @param pattern
+ * The pattern to set
*/
public void setPattern(Pattern pattern) {
this.pattern = pattern;
/**
* Returns true if the LifeLine is selected, false otherwise.
- *
+ *
* @return true if the LifeLine is selected, false otherwise
*/
public boolean isLifeLineSelected() {
/**
* Returns true if the Stop is selected, false otherwise.
- *
+ *
* @return true if the Stop is selected, false otherwise
*/
public boolean isStopSelected() {
/**
* Returns true if the SyncMessageReturn is selected, false otherwise.
- *
+ *
* @return true if the SyncMessageReturn is selected, false otherwise
*/
public boolean isSyncMessageReturnSelected() {
/**
* Returns true if the SyncMessage is selected, false otherwise.
- *
+ *
* @return true if the SyncMessage is selected, false otherwise
*/
public boolean isSyncMessageSelected() {
/**
* Sets the AsyncMessageReturn selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setAsyncMessageReturnSelected(boolean b) {
/**
* Sets the AsyncMessage selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setAsyncMessageSelected(boolean b) {
/**
* Sets the text entered by the user and compiles the regular expression.
- *
+ *
* @param string the text
*/
public void setExpression(String string) {
/**
* Sets the Stop selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setLifeLineSelected(boolean b) {
/**
* Set Stop selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setStopSelected(boolean b) {
/**
* Sets the SyncMessageReturn selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setSyncMessageReturnSelected(boolean b) {
/**
* Sets the SyncMessage selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setSyncMessageSelected(boolean b) {
/**
* Returns true if the case sensitive is selected, false otherwise.
- *
+ *
* @return true if the case sensitive is selected, false otherwise
*/
public boolean isCaseSenstiveSelected() {
/**
* Set case sensitive selection state.
- *
+ *
* @param b true if selected, false otherwise
*/
public void setCaseSenstiveSelected(boolean b) {
/**
* Compares this criteria with a given criteria.
- *
+ *
* @param to The criteria to compare
* @return usual comparison result (< 0, 0, > 0)
*/
retVal = getExpression().equals(to.getExpression());
} else if (to.getExpression() != null) {
retVal = to.getExpression().equals(getExpression());
- }
+ }
return retVal && isCaseSenstiveSelected() == to.isCaseSenstiveSelected() && isAsyncMessageReturnSelected() == to.isAsyncMessageReturnSelected() && isAsyncMessageSelected() == to.isAsyncMessageSelected()
&& isLifeLineSelected() == to.isLifeLineSelected() && isStopSelected() == to.isStopSelected() && isSyncMessageReturnSelected() == to.isSyncMessageReturnSelected() && isSyncMessageSelected() == to.isSyncMessageSelected();
}
/**
* Saves current criteria attributes in the dialog settings.
- *
+ *
* @param settings The dialog settings
*/
public void save(DialogSettings settings) {
/**
* Loads the criteria with values of the dialog settings.
- *
+ *
* @param settings The dialog settings
*/
public void load(DialogSettings settings) {
/**
* Gets the summary of supported graph nodes.
- *
+ *
* @param provider A filter provider
* @param loaderClassName A class loader
* @return graph node summary
StringBuffer ret = new StringBuffer();
String prefix = "["; //$NON-NLS-1$
for (Iterator<String> i = list.iterator(); i.hasNext();) {
- String s = (String) i.next();
+ String s = i.next();
ret.append(prefix);
ret.append(s);
prefix = " " + SDMessages._34 + " "; //$NON-NLS-1$ //$NON-NLS-2$
/**
* Matches given string using compiled pattern based on user expression.
- *
+ *
* @param stringToMatch A string to match
* @return true if string matches expression
*/
pattern = Pattern.compile(fExpression);
}
else {
- pattern = Pattern.compile(fExpression, Pattern.CASE_INSENSITIVE);
+ pattern = Pattern.compile(fExpression, Pattern.CASE_INSENSITIVE);
}
} catch (PatternSyntaxException e) {
pattern = null;