org.eclipse.e4.ui.workbench.modeling.EPartService.PartState Java Examples

The following examples show how to use org.eclipse.e4.ui.workbench.modeling.EPartService.PartState. 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: SwitchToBufferOtherCmd.java    From e4macs with Eclipse Public License 1.0 6 votes vote down vote up
void switchTo(MPart newPart) {
	if (getOrderedStacks(apart).size() == 1) {
		// case 1: 1 frame, split with miniPart
		// convenience hack: change direction on uArg
		splitIt(newPart, getDirection((isUniversalPresent()) ? !DISPLAY_HORIZONTAL : DISPLAY_HORIZONTAL));
	} else {
		// case 2: multiple stacks, move to adjacent stack
		// get the starting stack
		MElementContainer<MUIElement> stack = getParentStack(apart).getStack();
		// get the topart's stack
		MElementContainer<MUIElement> tstack = getParentStack(newPart).getStack();
		stack = findNextStack(apart, stack, 1);
		if (stack != null && stack != tstack) {
			modelService.move(newPart, stack, 0);
		}
	}
	if (displayOnly) {
		// brings to top
		partService.showPart(newPart, PartState.VISIBLE);
		reactivate(apart);
	} else {
		// bug in Kepler forces us to activate the old before the new
		reactivate(apart);
		reactivate(newPart);
	}
}
 
Example #2
Source File: TaskResultPart.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void doubleClick(DoubleClickEvent event){
	ITask selectedTask = (ITask) ((StructuredSelection) event.getSelection()).getFirstElement();
	MPart taskDetailPart =
		partService.createPart("ch.elexis.core.ui.tasks.partdescriptor.taskdetail");
	taskDetailPart.getTransientData().put("task", selectedTask);
	partService.showPart(taskDetailPart, PartState.CREATE);
}