/**********************************************************************
- * Copyright (c) 2005, 2008 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;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessage;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessageReturn;
/**
* This is the common dialog to define Find and/or Filter Criteria(s)
+ *
+ * @version 1.0
+ * @author Bernd Hufmann
*/
public class SearchFilterDialog extends Dialog {
*/
protected static final String FIND_EXPRESSION_LIST = "findExpressionList"; //$NON-NLS-1$
/**
- * The filter criteria poperty name
+ * The filter criteria poperty name
*/
protected static final String FILTER_CRITERIA = "filterCriteria"; //$NON-NLS-1$
/**
/**
* The okText is the text for the Ok button and title is the title of the dialog.<br>
- * Both depend (okText and title (below)) on the usage that is done of this dialog
+ * Both depend (okText and title (below)) on the usage that is done of this dialog
* (find or filter).
*/
protected String fOkText;
-
+
/**
* The title is the title of the dialog.<br>
- * Both depend (okText and title) on the usage that is done of this dialog
+ * Both depend (okText and title) on the usage that is done of this dialog
* (find or filter).
*/
protected String fTitle;
// ------------------------------------------------------------------------
/**
* Standard constructor
- *
+ *
* @param view A sequence diagram view reference
* @param provider A graph node supporter provider
- * @param filter A flag to indicate filtering (true) or finding (false)
+ * @param filter A flag to indicate filtering (true) or finding (false)
* @param style Style bits
*/
public SearchFilterDialog(SDView view, ISDGraphNodeSupporter provider, boolean filter, int style) {
fSdView = view;
fIsFind = !filter;
}
-
+
// ------------------------------------------------------------------------
// Methods
// ------------------------------------------------------------------------
@Override
public Control createDialogArea(Composite arg0) {
if (fIsFind) {
- fExpressionList = TmfUiPlugin.getDefault().getDialogSettings().getArray(FIND_EXPRESSION_LIST);
+ fExpressionList = Activator.getDefault().getDialogSettings().getArray(FIND_EXPRESSION_LIST);
} else {
- fExpressionList = TmfUiPlugin.getDefault().getDialogSettings().getArray(FILTER_EXPRESSION_LIST);
+ fExpressionList = Activator.getDefault().getDialogSettings().getArray(FILTER_EXPRESSION_LIST);
}
if (fExpressionList == null) {
fExpressionList = new String[0];
CRITERIA = FILTER_CRITERIA;
}
- DialogSettings section = (DialogSettings) TmfUiPlugin.getDefault().getDialogSettings().getSection(CRITERIA);
+ DialogSettings section = (DialogSettings) Activator.getDefault().getDialogSettings().getSection(CRITERIA);
List selection = fSdView.getSDWidget().getSelection();
if ((selection == null || selection.size() != 1) || (!fIsFind)) {
if (section != null) {
}
/**
- * Called when the dialog box ok button is pressed and calls back
+ * Called when the dialog box ok button is pressed and calls back
* the appropriate action provider (ISDFilterProvider or ISDFindProvider).
- *
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
@Override
public void okPressed() {
CRITERIA = FILTER_CRITERIA;
EXPRESSION_LIST = FILTER_EXPRESSION_LIST;
}
- DialogSettings settings = (DialogSettings) TmfUiPlugin.getDefault().getDialogSettings();
+ DialogSettings settings = (DialogSettings) Activator.getDefault().getDialogSettings();
DialogSettings section = (DialogSettings) settings.getSection(CRITERIA);
if (section == null) {
section = (DialogSettings) settings.addNewSection(CRITERIA);
int size = Math.min(list.size(), MAX_EXPRESSION_LIST);
String[] temp = new String[size];
for (int i = 0; i < size; i++) {
- temp[i] = (String) list.get(i);
+ temp[i] = list.get(i);
}
fExpressionList = temp;
settings.put(EXPRESSION_LIST, fExpressionList);
/**
* Returns the criteria
- *
+ *
* @return the criteria
*/
public Criteria getCriteria() {
/**
* Sets the criteria.
- *
+ *
* @param criteria the criteria to set.
*/
public void setCriteria(Criteria criteria) {
/**
* Returns the tab content reference.
- *
+ *
* @return the tab content
*/
protected TabContents getTabContents() {
/**
* Initialize the dialog with the settings of an existing Criteria<br>
* Criteria must not be null and the TabContents must have been created
- *
+ *
* @param from the criteria to copy from
*/
public void copyFromCriteria(Criteria from) {
/**
* Sets the text to be used for the ok button
- *
+ *
* @param okText text to set
*/
public void setOkText(String okText) {
/**
* Sets the title to be used for the dialog box.
- *
+ *
* @param title The title to set
*/
public void setTitle(String title) {