• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MTrimmedWindow类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow的典型用法代码示例。如果您正苦于以下问题:Java MTrimmedWindow类的具体用法?Java MTrimmedWindow怎么用?Java MTrimmedWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MTrimmedWindow类属于org.eclipse.e4.ui.model.application.ui.basic包,在下文中一共展示了MTrimmedWindow类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDetachedFrames

点赞 3

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
/**
 * Get the list of detached windows, if any
 * 
 * NB: The docs don't guarantee a non-null return, but the implementation seems to
 * Nor do they guarantee an order, but the implementation currently returns the same order
 * @return the list of detached windows 
 */
List<MTrimmedWindow> getDetachedFrames() {
	final MWindow topWindow = application.getChildren().get(0); 
	// NB Selectors aren't supported until Luna
	//		final Selector match = new Selector() {
	//			public boolean select(MApplicationElement element) {
	//				boolean result = element != topWindow && ((MTrimmedWindow)element).isToBeRendered();
	//				return result && !modelService.findElements((MUIElement)element, null, MPart.class, EDITOR_TAG, EModelService.IN_ANY_PERSPECTIVE).isEmpty();
	//			}
	//		};
	//		List<MTrimmedWindow> mts = modelService.findElements(topWindow, MTrimmedWindow.class, EModelService.IN_ANY_PERSPECTIVE, match); 
	// get the all detached editor trimmed windows
	// the implementation searches all detached windows in this case
	List<MTrimmedWindow> mts = modelService.findElements(topWindow, null, MTrimmedWindow.class, null, EModelService.IN_ANY_PERSPECTIVE); 
	List<MTrimmedWindow> refined = new ArrayList<MTrimmedWindow>();
	for (MTrimmedWindow mt : mts) {
		if (mt != topWindow && mt.isToBeRendered() && !modelService.findElements(mt, null, MPart.class, EDITOR_TAG, EModelService.IN_ANY_PERSPECTIVE).isEmpty()) {
			refined.add(mt);
		}
	}
	return refined; 
}
 

开发者ID:MulgaSoft,
项目名称:e4macs,
代码行数:29,
代码来源:E4WindowCmd.java

示例2: getAdjacentElement

点赞 3

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
/**
 * @see com.mulgasoft.emacsplus.e4.commands.E4WindowCmd#getAdjacentElement(org.eclipse.e4.ui.model.application.ui.MElementContainer, boolean, org.eclipse.e4.ui.model.application.ui.basic.MPart)
 */
protected MElementContainer<MUIElement> getAdjacentElement(MElementContainer<MUIElement> dragStack, MPart part, boolean stackp) {
	MElementContainer<MUIElement> result = null;
	if (dragStack != null) {
		MElementContainer<MUIElement> psash = dragStack.getParent();
		MElementContainer<MUIElement> top = getTopElement(psash);
		if ((Object)top instanceof MTrimmedWindow) {
			// if we contain splits, remove them first
			if (top != psash) {
				super.joinAll(part);
			}
			Collection<MPart> parts = getParts(application.getChildren().get(0), EModelService.IN_SHARED_AREA);
			for (MPart p : parts) {
				List<MElementContainer<MUIElement>> all = getOrderedStacks(p);
				// if it has a PartStack, it sh/c/ould be an editor stack
				if (!all.isEmpty()) {
					result = all.get(0);
					break;
				};
			};
		}
	}
	return result;
}
 

开发者ID:MulgaSoft,
项目名称:e4macs,
代码行数:27,
代码来源:FrameJoinCmd.java

示例3: execute

点赞 3

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
@Execute
public Object execute(@Active MWindow apart, @Active IEditorPart editor, @Active EmacsPlusCmdHandler handler) {
	// This assumes that getDatchedFrames returns them in order
	List<MTrimmedWindow> frames = getDetachedFrames();
	if (frames != null && !frames.isEmpty()) {
		int size = frames.size()+1;
		int count = handler.getUniversalCount();
		int index = frames.indexOf(apart) + (count % size) + 1;
		index = (index < 0 ? index + size : (index < size) ? index : index - size);
		if (index == 0) {
			// just make the main window first in line
			focusIt(getEditArea(application.getChildren().get(0)));
		} else {
			focusIt(frames.get(--index));
		}
	}
	return null;
}
 

开发者ID:MulgaSoft,
项目名称:e4macs,
代码行数:19,
代码来源:FrameOtherCmd.java

示例4: createFastViewStack

点赞 3

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private static MPartStack createFastViewStack(MTrimmedWindow window, MPerspective mPerspective,
	EModelService eModelService){
	
	if (window != null && mPerspective != null) {
		MPartStack mPartStack = eModelService.createModelElement(MPartStack.class);
		mPartStack.setElementId(ELEXIS_FASTVIEW_STACK);
		mPartStack.setToBeRendered(true);
		mPartStack.getTags().add("Minimized");
		mPartStack.setOnTop(false);
		mPartStack.setVisible(false);
		mPartStack.getTags().add("NoAutoCollapse");
		mPartStack.getTags().add("active");
		mPerspective.getChildren().add(0, mPartStack);
		return mPartStack;
	}
	return null;
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:18,
代码来源:ElexisFastViewUtil.java

示例5: createFastViewToolControl

点赞 3

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private static MToolControl createFastViewToolControl(MTrimmedWindow window,
	MPerspective mPerspective, EModelService eModelService, MTrimBar mTrimBar){
	if (mTrimBar != null) {
		MToolControl mToolControl = eModelService.createModelElement(MToolControl.class);
		mToolControl.setElementId(getToolControlId(window, mPerspective));
		mToolControl.setContributionURI(
			"bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.TrimStack");
		mToolControl.setToBeRendered(true);
		mToolControl.setVisible(true);
		mToolControl.getTags().add("TrimStack");
		mToolControl.getPersistedState().put("YSize", "600");
		mTrimBar.getChildren().add(0, mToolControl);
		mTrimBar.setVisible(true);
		mTrimBar.setToBeRendered(true);
		
		return mToolControl;
	}
	return null;
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:20,
代码来源:ElexisFastViewUtil.java

示例6: execute

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
/**
 * Executes the model processor.
 */
@Execute public void execute() {
	MTrimmedWindow window = (MTrimmedWindow) this.modelService.find(ID_TRIMMED_WINDOW, this.application);
	if (window==null) {
		System.err.println(this.getClass().getSimpleName() + ": Could not find Trimmed Window '" + ID_TRIMMED_WINDOW + "' - The menus could be missed.");
		return;
	} else if (window.getMainMenu()!=null) {
		if (window.getMainMenu().getElementId().equals(ID_MAIN_MENUE_ELEMENT)==false) {
			System.err.println(this.getClass().getSimpleName() + ": Main menu of window '" + ID_TRIMMED_WINDOW + "' was not '" + ID_MAIN_MENUE_ELEMENT + "'.");
		} else {
			return;
		}
	}
	window.setMainMenu(this.createEmptyMainMenu());
}
 

开发者ID:EnFlexIT,
项目名称:AgentWorkbench,
代码行数:18,
代码来源:ApplicationModelMainMenuProcessor.java

示例7: showProgressBar

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private void showProgressBar(MApplication app){
	MTrimmedWindow window = (MTrimmedWindow) app.getChildren().get(0);
	
	for(MTrimBar trimbar : window.getTrimBars()){
		for(MTrimElement element : trimbar.getChildren()){
			if("org.eclipse.ui.ProgressBar".equals(element.getElementId())){
				element.setToBeRendered(true);
				element.setVisible(true);
			}

		}
	}
}
 

开发者ID:CloudScale-Project,
项目名称:Environment,
代码行数:14,
代码来源:BottomTrimbarAddon.java

示例8: joinAll

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
@Override
void joinAll(MPart apart) {
	joined = true;
	List<MTrimmedWindow> frames = getDetachedFrames();
	MElementContainer<MUIElement> last = getTopElement((MElementContainer<MUIElement>) apart.getParent());
	for (MTrimmedWindow mt : frames) {
		if (!mt.equals(last)) {
			joinOne(mt);
		}
	}
	// only join apart if its top element is a frame
	if ((Object)last instanceof MTrimmedWindow) {
		super.joinOne(apart);
	}
}
 

开发者ID:MulgaSoft,
项目名称:e4macs,
代码行数:16,
代码来源:FrameJoinCmd.java

示例9: joinOne

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
void joinOne(MTrimmedWindow mt) {
	// As long as it has any editor MParts, we can join it
	List<MPart> parts = getParts(mt, EModelService.IN_ANY_PERSPECTIVE);
	if (!parts.isEmpty()) {
		super.joinOne(parts.get(0));
	}
}
 

开发者ID:MulgaSoft,
项目名称:e4macs,
代码行数:8,
代码来源:FrameJoinCmd.java

示例10: findTrimBar

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private static MTrimBar findTrimBar(EModelService eModelService, MTrimmedWindow workbenchWindow,
	SideValue sideValue){
	if (workbenchWindow != null) {
		MTrimBar trimbar = eModelService.getTrim(workbenchWindow, sideValue);
		return trimbar;
	}
	return null;
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:9,
代码来源:ElexisFastViewUtil.java

示例11: getActivePerspective

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
public static MPerspective getActivePerspective(){
	EModelService modelService = getService(EModelService.class);
	MTrimmedWindow mWindow = getActiveWindow();
	if (mWindow != null) {
		return modelService.getActivePerspective(mWindow);
	}
	return null;
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:9,
代码来源:PerspectiveUtil.java

示例12: getActivePerspective

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private MPerspective getActivePerspective(){
	EModelService modelService = getService(EModelService.class);
	MTrimmedWindow mWindow = getActiveWindow();
	if (mWindow != null) {
		return modelService.getActivePerspective(mWindow);
	}
	return null;
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:9,
代码来源:PerspectiveImportService.java

示例13: alreadyFramed

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private boolean alreadyFramed(MWindow partWindow, List<MTrimmedWindow> frames) {
	// NB: This differs from emacs behavior, but seems much more useful in Eclipse
	// as it allows easily adding a buffer to a frame's stack.
	// buffer is in a frame, and command comes from main window
	return frames.contains(partWindow) && !frames.contains(window);
}
 

开发者ID:MulgaSoft,
项目名称:e4macs,
代码行数:7,
代码来源:SwitchToBufferFrameCmd.java

示例14: addToFastView

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
/**
 * Adds a view to the fastview, if {@link MPartStack} not exists it will be created and the view
 * will be added within a {@link MPlaceholder} element.
 * 
 * @param perspectiveId
 * @param viewId
 */
public static void addToFastView(String perspectiveId, String viewId){
	EModelService eModelService = getService(EModelService.class);
	MApplication mApplication = getService(MApplication.class);
	
	MTrimmedWindow window = getCurrentWindow(eModelService, mApplication);
	
	if (window != null) {
		Object obj = eModelService.find(perspectiveId, mApplication);
		if (obj instanceof MPerspective) {
			MPerspective mPerspective = (MPerspective) obj;
			// check if fastview stack exists
			MPartStack stack =
				(MPartStack) eModelService.find(ELEXIS_FASTVIEW_STACK, mPerspective);
			
			if (stack == null) {
				stack = createFastViewStack(window, mPerspective, eModelService);
			}
			if (stack != null) {
				// check if toolcontrol exists
				MToolControl toolControl = (MToolControl) eModelService
					.find(getToolControlId(window, mPerspective), mApplication);
				
				if (toolControl == null) {
					MTrimBar mTrimBar = eModelService.getTrim(window, SideValue.BOTTOM);
					if (toolControl == null) {
						toolControl = createFastViewToolControl(window, mPerspective,
							eModelService, mTrimBar);
					}
				}
				if (toolControl != null
					&& !ElexisFastViewUtil.isViewInsideFastview(stack, viewId)
					&& mApplication.getContext().getActiveChild() != null) {
					EPartService partService = getService(EPartService.class);
					MPlaceholder placeholder = partService.createSharedPart(viewId);
					placeholder.setToBeRendered(true);
					placeholder.setElementId(viewId);
					placeholder.setCloseable(true);
					placeholder.getTags().add(EPartService.REMOVE_ON_HIDE_TAG);
					((MPart) placeholder.getRef()).setToBeRendered(true);
					stack.getChildren().add(placeholder); // Add part to stack
				}
				
			}
		}
	}
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:54,
代码来源:ElexisFastViewUtil.java

示例15: getToolControlId

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
private static String getToolControlId(MTrimmedWindow window, MPerspective mPerspective){
	return getToolControlId(window, mPerspective.getElementId());
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:4,
代码来源:ElexisFastViewUtil.java

示例16: changeFastViewBarFromLeftToBottom

点赞 2

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
/**
 * Changes the fastviews position from left trimbar to bottom trimbar
 */
public static void changeFastViewBarFromLeftToBottom(){
	EModelService eModelService = getService(EModelService.class);
	MApplication mApplication = getService(MApplication.class);
	MTrimmedWindow mWindow = getCurrentWindow(eModelService, mApplication);
	if (mWindow != null) {
		MPerspective mPerspective = eModelService.getActivePerspective(mWindow);
		
		if (mPerspective != null) {
			String perspectiveId = mPerspective.getElementId();
			
			MToolControl mToolControl =
				findFastViewToolControl(eModelService, mWindow, perspectiveId,
					SideValue.BOTTOM);
			if (mToolControl == null) {
				mToolControl = findFastViewToolControl(eModelService, mWindow, perspectiveId,
					SideValue.LEFT);
				if (mToolControl != null) {
					MTrimBar trimBarBottom =
						findTrimBar(eModelService, mWindow, SideValue.BOTTOM);
					if (trimBarBottom != null) {
						MToolControl copyToolcontrol =
							eModelService.createModelElement(MToolControl.class);
						copyToolcontrol.setElementId(mToolControl.getElementId());
						copyToolcontrol.setContributionURI(
							"bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.TrimStack");
						copyToolcontrol.setToBeRendered(true);
						copyToolcontrol.setVisible(true);
						copyToolcontrol.getTags().add("TrimStack");
						
						copyToolcontrol.getPersistedState().put("YSize", "600");
						trimBarBottom.getChildren().add(0, copyToolcontrol);
						
						mToolControl.setToBeRendered(false);
						mToolControl.setVisible(false);
						mToolControl.getParent().getChildren().remove(mToolControl);
						mToolControl.setParent(null);
						trimBarBottom.setVisible(true);
						trimBarBottom.setToBeRendered(true);
					}
					
				}
			}
			else {
				mToolControl.setToBeRendered(true);
			}
		}
	}
}
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:52,
代码来源:ElexisFastViewUtil.java

示例17: getActiveWindow

点赞 1

import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow; //导入依赖的package包/类
/**
 * Returns the active window
 * 
 * @return
 */
public MTrimmedWindow getActiveWindow();
 

开发者ID:elexis,
项目名称:elexis-3-core,
代码行数:7,
代码来源:IPerspectiveImportService.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)