/**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2013 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.preferences;
import java.util.Iterator;
/**
* The Sequence Diagram preferences page implementation.
- *
+ *
* @version 1.0
* @author sveyrier
*/
* Temporary preferences tag
*/
protected static final String TEMP_TAG = SDViewPref.TEMP_TAG;
-
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
*/
protected IntegerFieldEditor fLifelineWidth = null;
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
- /**
- * Default constructor
- */
- public SDViewerPage() {
- super();
- }
-
// ------------------------------------------------------------------------
// Methods
// ------------------------------------------------------------------------
page.setLayoutData(pageLayoutdata);
page.setLayout(pageLayout);
- fTooltip = new BooleanFieldEditor(SDViewPref.PREF_TOOLTIP, SDMessages._97, page);
+ fTooltip = new BooleanFieldEditor(ISDPreferences.PREF_TOOLTIP, SDMessages._97, page);
fTooltip.setPreferenceStore(fPreferences.getPreferenceStore());
fTooltip.load();
// link font with zoom pref
- fLink = new BooleanFieldEditor(SDViewPref.PREF_LINK_FONT, SDMessages._82, page);
+ fLink = new BooleanFieldEditor(ISDPreferences.PREF_LINK_FONT, SDMessages._82, page);
fLink.setPreferenceStore(fPreferences.getPreferenceStore());
fLink.load();
- fNoExternalTime = new BooleanFieldEditor(SDViewPref.PREF_EXCLUDE_EXTERNAL_TIME, SDMessages._83, page);
+ fNoExternalTime = new BooleanFieldEditor(ISDPreferences.PREF_EXCLUDE_EXTERNAL_TIME, SDMessages._83, page);
fNoExternalTime.setPreferenceStore(fPreferences.getPreferenceStore());
fNoExternalTime.load();
// use gradient color pref
- fUseGrad = new BooleanFieldEditor(SDViewPref.PREF_USE_GRADIENT, SDMessages._84, page);
+ fUseGrad = new BooleanFieldEditor(ISDPreferences.PREF_USE_GRADIENT, SDMessages._84, page);
fUseGrad.setPreferenceStore(fPreferences.getPreferenceStore());
fUseGrad.load();
prefPage.setLayout(prefPageLayout);
// swimLane width pref
- fLifelineWidth = new IntegerFieldEditor(SDViewPref.PREF_LIFELINE_WIDTH, SDMessages._80, prefPage);
+ fLifelineWidth = new IntegerFieldEditor(ISDPreferences.PREF_LIFELINE_WIDTH, SDMessages._80, prefPage);
fLifelineWidth.setPreferenceStore(fPreferences.getPreferenceStore());
fLifelineWidth.setValidRange(119, 500);
fLifelineWidth.load();
performApply();
return true;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
fTextColor.store();
String[] fontList = SDViewPref.getFontList();
-
+
// set the FontFieldEditor for the new selected graphNode font
fFont.setPreferenceName(fontList[fClassItemList.getSelectionIndex()] + TEMP_TAG);
fFont.load();
fTextColor.load();
// No Background for message graphNodes
- if ((fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_SYNC_MESS)) || (fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_SYNC_MESS_RET))
- || (fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_ASYNC_MESS)) || (fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_ASYNC_MESS_RET))) {
+ if ((fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_SYNC_MESS)) || (fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_SYNC_MESS_RET))
+ || (fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_ASYNC_MESS)) || (fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_ASYNC_MESS_RET))) {
fBackGroundColor.setEnabled(false, fButtonArea);
} else {
fBackGroundColor.setEnabled(true, fButtonArea);
}
// No font used for execution occurrence and global frame
- if ((fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_EXEC)) || (fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_FRAME))) {
+ if ((fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_EXEC)) || (fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_FRAME))) {
fTextColor.setEnabled(false, fButtonArea);
} else {
fTextColor.setEnabled(true, fButtonArea);
}
- if (fontList[fClassItemList.getSelectionIndex()].equals(SDViewPref.PREF_FRAME)) {
+ if (fontList[fClassItemList.getSelectionIndex()].equals(ISDPreferences.PREF_FRAME)) {
fFont.setEnabled(false, fButtonArea);
} else {
fFont.setEnabled(true, fButtonArea);
}
}
+ /**
+ * Swap viewer preferences.
+ *
+ * @param toTemp Switch to the temporary preferences
+ */
protected void swapPref(boolean toTemp) {
String TAG1 = "";//$NON-NLS-1$
String TAG2 = TEMP_TAG;