org.eclipse.ui.dialogs.PropertyDialogAction Java Examples

The following examples show how to use org.eclipse.ui.dialogs.PropertyDialogAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NewTextSearchActionGroup.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
public NewTextSearchActionGroup(IViewPart part) {
    Assert.isNotNull(part);
    IWorkbenchPartSite site = part.getSite();
    fSelectionProvider = site.getSelectionProvider();
    fPage = site.getPage();
    fOpenPropertiesDialog = new PropertyDialogAction(site, fSelectionProvider);
    fOpenAction = new OpenFileAction(fPage);
    ISelection selection = fSelectionProvider.getSelection();

    if (selection instanceof IStructuredSelection) {
        fOpenPropertiesDialog.selectionChanged((IStructuredSelection) selection);
    } else {
        fOpenPropertiesDialog.selectionChanged(selection);
    }

}
 
Example #2
Source File: NewTextSearchActionGroup.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
public NewTextSearchActionGroup(IViewPart part) {
    Assert.isNotNull(part);
    IWorkbenchPartSite site = part.getSite();
    fSelectionProvider = site.getSelectionProvider();
    fPage = site.getPage();
    fOpenPropertiesDialog = new PropertyDialogAction(site, fSelectionProvider);
    fOpenAction = new OpenFileAction(fPage);
    ISelection selection = fSelectionProvider.getSelection();

    if (selection instanceof IStructuredSelection) {
        fOpenPropertiesDialog.selectionChanged((IStructuredSelection) selection);
    } else {
        fOpenPropertiesDialog.selectionChanged(selection);
    }

}
 
Example #3
Source File: PropertiesHandler.java    From tlaplus with MIT License 5 votes vote down vote up
/**
    * {@inheritDoc}
    */
public Object execute(ExecutionEvent event) throws ExecutionException {
	final IAction action = new PropertyDialogAction(UIHelper.getShellProvider(), Activator.getSpecManager());

	action.run();

	return null;
}
 
Example #4
Source File: ModulePropertiesHandler.java    From tlaplus with MIT License 5 votes vote down vote up
public Object execute(ExecutionEvent event) throws ExecutionException
{

    IAction action = new PropertyDialogAction(UIHelper.getShellProvider(), UIHelper
            .getActiveEditorFileSelectionProvider());
    action.run();

    return null;
}
 
Example #5
Source File: GamaNavigator.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void createPartControl(final Composite compo) {
	this.parent = GamaToolbarFactory.createToolbars(this, compo);

	super.createPartControl(parent);
	restoreState();
	final IToolBarManager tb = getViewSite().getActionBars().getToolBarManager();
	for (final IContributionItem item : tb.getItems()) {
		if (item instanceof ActionContributionItem) {
			final ActionContributionItem aci = (ActionContributionItem) item;
			final IAction action = aci.getAction();
			if (action instanceof LinkEditorAction) {
				link = action;
				tb.remove(aci);
			} else if (action instanceof org.eclipse.ui.internal.navigator.actions.CollapseAllAction) {
				tb.remove(aci);
			}

		}
	}
	linkItem.setSelection(link.isChecked());
	tb.update(true);
	tb.insertBefore("toolbar.toggle", byDate.toCheckAction());
	tb.insertBefore("toolbar.toggle", expandAll.toAction());
	tb.insertBefore(expandAll.getId(), collapseAll.toAction());

	try {
		final IDecoratorManager mgr = PlatformUI.getWorkbench().getDecoratorManager();
		mgr.setEnabled("msi.gama.application.date.decorator", false);
	} catch (final CoreException e) {
		e.printStackTrace();
	}
	properties =
			new PropertyDialogAction(new SameShellProvider(getSite().getShell()), getSite().getSelectionProvider());
	findControl.initialize();

}
 
Example #6
Source File: OpenViewActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void createSiteActions(IWorkbenchSite site, ISelectionProvider specialProvider) {
	fOpenImplementation= new OpenImplementationAction(site);
	fOpenImplementation.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_IMPLEMENTATION);
	fOpenImplementation.setSpecialSelectionProvider(specialProvider);
	
	fOpenSuperImplementation= new OpenSuperImplementationAction(site);
	fOpenSuperImplementation.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_SUPER_IMPLEMENTATION);
	fOpenSuperImplementation.setSpecialSelectionProvider(specialProvider);

	fOpenAttachedJavadoc= new OpenAttachedJavadocAction(site);
	fOpenAttachedJavadoc.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_ATTACHED_JAVADOC);
	fOpenAttachedJavadoc.setSpecialSelectionProvider(specialProvider);

	fOpenTypeHierarchy= new OpenTypeHierarchyAction(site);
	fOpenTypeHierarchy.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_TYPE_HIERARCHY);
	fOpenTypeHierarchy.setSpecialSelectionProvider(specialProvider);

	fOpenCallHierarchy= new OpenCallHierarchyAction(site);
	fOpenCallHierarchy.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_CALL_HIERARCHY);
	fOpenCallHierarchy.setSpecialSelectionProvider(specialProvider);

	ISelectionProvider provider= specialProvider != null ? specialProvider : site.getSelectionProvider();

	fOpenPropertiesDialog= new PropertyDialogAction(site, provider);
	fOpenPropertiesDialog.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES);

	initialize(provider);
}
 
Example #7
Source File: PropertiesActionProvider.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public void init(final ICommonActionExtensionSite aSite) {
	
	delegateSelectionProvider = new DelegateSelectionProvider( aSite.getViewSite().getSelectionProvider());
	propertiesAction = new PropertyDialogAction(new IShellProvider() {
		public Shell getShell() {
			return aSite.getViewSite().getShell();
		}
	},delegateSelectionProvider);
	propertiesAction.setText("属性");
	propertiesAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES); 
}
 
Example #8
Source File: PropertiesActionProvider.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public void init(final ICommonActionExtensionSite aSite) {
	
	delegateSelectionProvider = new DelegateSelectionProvider( aSite.getViewSite().getSelectionProvider());
	propertiesAction = new PropertyDialogAction(new IShellProvider() {
		public Shell getShell() {
			return aSite.getViewSite().getShell();
		}
	},delegateSelectionProvider);
	propertiesAction.setText("属性");
	propertiesAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES); 
}
 
Example #9
Source File: PatientenListeView.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void createPartControl(final Composite parent) {
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.verticalSpacing = 0;

	this.parent = parent;
	this.parent.setLayout(layout);

	cv = new CommonViewer();

	collectUserFields();
	plcp = new PatListeContentProvider(cv, currentUserFields, this);
	makeActions();
	//		plfb = new PatListFilterBox(parent);
	//		plfb.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
	//		((GridData) plfb.getLayoutData()).heightHint = 0;

	dcfp = new DefaultControlFieldProvider(cv, currentUserFields) {
		@Override
		public void setQuery(IQuery<?> query){
			for (int i = 0; i < dbFields.length; i++) {
				if (!lastFiltered[i].equals(StringTool.leer)) {
					if ("dob".equals(dbFields[i])) {
						query.and(dbFields[i], COMPARATOR.LIKE,
							NoPoUtil.getElexisDateSearchString(lastFiltered[i]), true);
					} else {
						query.and(dbFields[i], COMPARATOR.LIKE, lastFiltered[i] + "%", true);
					}
				}
			}
		}
	};
	updateFocusField();

	vc = new ViewerConfigurer(plcp, new PatLabelProvider(), dcfp,
		new ViewerConfigurer.DefaultButtonProvider(),
			new SimpleWidgetProvider(SimpleWidgetProvider.TYPE_LAZYLIST, SWT.SINGLE, cv));
	cv.create(vc, parent, SWT.NONE, getViewSite());
	// let user select patient by pressing ENTER in the control fields
	cv.getConfigurer().getControlFieldProvider().addChangeListener(new ControlFieldSelectionListener());
	cv.getViewerWidget().getControl().setFont(UiDesk.getFont(Preferences.USR_DEFAULTFONT));
	
	plcp.startListening();
	GlobalEventDispatcher.addActivationListener(this, this);

	populateViewMenu();

	StructuredViewer viewer = cv.getViewerWidget();
	viewer.addDoubleClickListener(new IDoubleClickListener() {

		@Override
		public void doubleClick(DoubleClickEvent event) {
			PropertyDialogAction pdAction = new PropertyDialogAction(new SameShellProvider(parent),
					PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite()
							.getSelectionProvider());

			if (pdAction.isApplicableForSelection())
				pdAction.run();
		}
	});
	getSite().registerContextMenu(menus.getContextMenu(), viewer);
	getSite().setSelectionProvider(viewer);

	// // ****DoubleClick Version Marlovits -> öffnet bei DoubleClick die
	// Patienten-Detail-Ansicht
	// cv.addDoubleClickListener(new DoubleClickListener() {
	// @Override
	// public void doubleClicked(PersistentObject obj, CommonViewer cv){
	// try {
	// PatientDetailView2 pdv =
	// (PatientDetailView2)
	// getSite().getPage().showView(PatientDetailView2.ID);
	// } catch (PartInitException e) {
	// ExHandler.handle(e);
	// }
	// }
	// });
	created = true;
}