/**********************************************************************
- * 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
+ * IBM - Initial API and implementation
+ * Bernd Hufmann - Updated for TMF
**********************************************************************/
+
package org.eclipse.linuxtools.tmf.ui.views.uml2sd;
import java.util.Iterator;
* @param resetPosition boolean Flag whether to reset the position or not.
*/
protected void setFrame(Frame frame, boolean resetPosition) {
- if (fSdWidget == null) {
+ if (getSDWidget() == null) {
return;
}
}
IUml2SDLoader loader = LoadersManager.getInstance().getCurrentLoader(getViewSite().getId(), this);
+ if (loader == null) {
+ return;
+ }
- if ((loader != null) && (loader.getTitleString() != null)) {
+ if (loader.getTitleString() != null) {
setContentDescription(loader.getTitleString());
}
- if (getSDWidget() != null) {
- getSDWidget().setFrame(frame, resetPosition);
- }
+ getSDWidget().setFrame(frame, resetPosition);
if (fTimeCompressionBar != null) {
fTimeCompressionBar.setFrame(frame);
}
updateCoolBar();
- if (!frame.hasTimeInfo()) {
- Composite parent = fTimeCompressionBar.getParent();
- fTimeCompressionBar.setVisible(false);
- parent.layout(true);
- } else {
- Composite parent = fTimeCompressionBar.getParent();
- fTimeCompressionBar.setVisible(true);
- parent.layout(true);
+ if (fTimeCompressionBar != null) {
+ if (!frame.hasTimeInfo()) {
+ Composite parent = fTimeCompressionBar.getParent();
+ fTimeCompressionBar.setVisible(false);
+ parent.layout(true);
+ } else {
+ Composite parent = fTimeCompressionBar.getParent();
+ fTimeCompressionBar.setVisible(true);
+ parent.layout(true);
+ }
}
IContributionItem shortKeysMenu = getViewSite().getActionBars().getMenuManager().find("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers");//$NON-NLS-1$
MenuManager shortKeys = (MenuManager) shortKeysMenu;
getSDWidget().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
- if (getSDWidget() == null || getSDWidget().isDisposed()) {
+ if (getSDWidget() == null || getSDWidget().isDisposed() ||
+ ((fTimeCompressionBar != null) && fTimeCompressionBar.isDisposed())) {
return;
}
setFrame(frame);
if (getSDWidget() != null) {
return getSDWidget().getFrame();
}
- else {
- return null;
- }
+ return null;
}
/**
if ((loader != null)) {// &&( LoadersManager.getLoadersManager().getViewer(l)==this)){
loader.setViewer(this);
return false;
- } else {
- loadBlank();
- return true;
}
+ loadBlank();
+ return true;
}
/**
* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#getAdapter(java.lang.Class)
*/
- @SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
Object obj = super.getAdapter(adapter);