use of org.eclipse.wst.xsd.ui.internal.design.editparts.TopLevelComponentEditPart in project webtools.sourceediting by eclipse.
the class XSDBaseAction method doEdit.
protected void doEdit(Object obj, IWorkbenchPart part) {
if (obj instanceof TopLevelComponentEditPart) {
TopLevelComponentEditPart editPart = (TopLevelComponentEditPart) obj;
if (addedComponent == ((XSDBaseAdapter) editPart.getModel()).getTarget()) {
editPart.setScroll(true);
editPart.addFeedback();
editPart.doEditName(!(part instanceof ContentOutline));
}
} else if (obj instanceof BaseFieldEditPart) {
BaseFieldEditPart editPart = (BaseFieldEditPart) obj;
editPart.doEditName(!(part instanceof ContentOutline));
} else if (obj instanceof IAutoDirectEdit) {
((IAutoDirectEdit) obj).doEditName(!(part instanceof ContentOutline));
}
}
use of org.eclipse.wst.xsd.ui.internal.design.editparts.TopLevelComponentEditPart in project webtools.sourceediting by eclipse.
the class TopLevelNameDirectEditManager method bringDown.
/**
* @see org.eclipse.gef.tools.DirectEditManager#bringDown()
*/
protected void bringDown() {
if (actionHandler != null) {
actionHandler.dispose();
actionHandler = null;
}
if (actionBars != null) {
restoreSavedActions(actionBars);
actionBars.updateActionBars();
actionBars = null;
}
Font disposeFont = scaledFont;
scaledFont = null;
super.bringDown();
if (disposeFont != null)
disposeFont.dispose();
if (getEditPart() instanceof TopLevelComponentEditPart) {
Runnable runnable = new Runnable() {
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorPart editor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
Object adapter = editor.getAdapter(ISelectionProvider.class);
if (adapter instanceof ISelectionProvider) {
ISelectionProvider sel = (ISelectionProvider) adapter;
sel.setSelection(new StructuredSelection(getEditPart().getModel()));
}
}
};
Display.getCurrent().asyncExec(runnable);
}
}
Aggregations