/*
* Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis,
* Rick Salay.
* 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:
* Alessio Di Sandro - Implementation.
*/
package edu.toronto.cs.se.modelepedia.classdiagram.diagram.part;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.part.DefaultElementChooserDialog;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
/**
* @generated
*/
public class ClassDiagramElementChooserDialog extends DefaultElementChooserDialog {
/**
* @generated
*/
public ClassDiagramElementChooserDialog(Shell parentShell, View view) {
this(parentShell, view, false);
}
/**
* @generated
*/
public ClassDiagramElementChooserDialog(Shell parentShell, View view, boolean allowMultiSelection) {
super(parentShell, view, new ClassDiagramElementChooserDialogContextImpl(allowMultiSelection));
}
/**
* @generated
*/
private static class ClassDiagramElementChooserDialogContextImpl implements DefaultElementChooserDialog.Context {
/**
* @generated
*/
private static final String[] FILE_EXTENSIONS = new String[] { "classdiagram" };
/**
* @generated
*/
private final boolean myAllowMultiSelection;
/**
* @generated
*/
private ClassDiagramElementChooserDialogContextImpl(boolean allowMultiSelection) {
myAllowMultiSelection = allowMultiSelection;
}
/**
* @generated
*/
@Override
public AdapterFactory getAdapterFactory() {
return ClassDiagramDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory();
}
/**
* @generated
*/
@Override
public PreferencesHint getPreferenceHint() {
return ClassDiagramDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
}
/**
* @generated
*/
@Override
public String[] getFileExtesions() {
return FILE_EXTENSIONS.clone();
}
/**
* @generated
*/
@Override
public String getDialogTitle() {
return Messages.ClassDiagramElementChooserDialog_SelectModelElementTitle;
}
/**
* @generated
*/
@Override
public ITreeContentProvider getTreeContentProvider() {
return new BaseWorkbenchContentProvider();
}
/**
* @generated
*/
public boolean allowMultiSelection() {
return myAllowMultiSelection;
}
}
}