org.eclipse.ui.presentations.IStackPresentationSite源码实例Demo

类org.eclipse.ui.presentations.IStackPresentationSite源码实例Demo

下面列出了org.eclipse.ui.presentations.IStackPresentationSite 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: nebula   文件: PresentationFactory.java
/** 
 * {@inheritDoc}
 */
@Override
public StackPresentation createStandaloneViewPresentation(Composite parent,
                                                          IStackPresentationSite site,
                                                          boolean showTitle)
{
    if (showTitle)
    {
        if ("group".equals(site.getProperty("type")))
        {
            return new PGroupStackPresentation(site,parent);
        }            
        else
        {
            return new ExpandBarStandaloneStackPresentation(site,parent);
        }            
    }
    else
    {
        return new EmptyStandaloneStackPresentation(site,parent);
    }
}
 
源代码2 项目: nebula   文件: PGroupStackPresentation.java
/** 
 * {@inheritDoc}
 */
@Override
public void setState(int state)
{
    if (state == IStackPresentationSite.STATE_MINIMIZED)
    {
        group.setExpanded(false);
    }
    else if(state == IStackPresentationSite.STATE_RESTORED)
    {
        group.setExpanded(true);
    }
}
 
源代码3 项目: nebula   文件: CTabFolderStackPresentation.java
/** 
 * {@inheritDoc}
 */
@Override
public void setState(int state)
{
    if (state == IStackPresentationSite.STATE_MAXIMIZED)
        tabFolder.setMaximized(true);
    if (state == IStackPresentationSite.STATE_RESTORED)
    {
        tabFolder.setMaximized(false);
        tabFolder.setMinimized(false);
    }
    if (state == IStackPresentationSite.STATE_MINIMIZED)
        tabFolder.setMinimized(true);
}
 
源代码4 项目: nebula   文件: PresentationFactory.java
/** 
 * {@inheritDoc}
 */
@Override
public StackPresentation createViewPresentation(Composite parent, IStackPresentationSite site)
{
    if ("group".equals(site.getProperty("type")))
    {
        return new PGroupStackPresentation(site,parent);
    }     
    return new PShelfStackPresentation(site,parent);
}
 
/** 
 * {@inheritDoc}
 */
@Override
public void setState(int state)
{
    if (state == IStackPresentationSite.STATE_MINIMIZED)
    {
        eBarItem.setExpanded(false);
    }
    else if(state == IStackPresentationSite.STATE_RESTORED)
    {
        eBarItem.setExpanded(true);
    }
}
 
/**
 * Create the standard view menu
 * 
 * @param site the site to associate the view with
 */
public StandardEditorSystemMenu(IStackPresentationSite site) {
    restore = new SystemMenuRestore(site);
    move = new SystemMenuMove(site, getMoveMenuText(), false);
    minimize = new SystemMenuMinimize(site);
    maximize = new SystemMenuMaximize(site);
    close = new SystemMenuClose(site);
    closeOthers = new SystemMenuCloseOthers(site);
    closeAll = new SystemMenuCloseAll(site);
    
    { // Initialize system menu
        menuManager.add(new GroupMarker("misc")); //$NON-NLS-1$
        menuManager.add(new GroupMarker("restore")); //$NON-NLS-1$
        menuManager.add(new UpdatingActionContributionItem(restore));

        menuManager.add(move);
        menuManager.add(new GroupMarker("size")); //$NON-NLS-1$
        menuManager.add(new GroupMarker("state")); //$NON-NLS-1$
        menuManager.add(new UpdatingActionContributionItem(minimize));

        menuManager.add(new UpdatingActionContributionItem(maximize));
        menuManager.add(new Separator("close")); //$NON-NLS-1$
        menuManager.add(close);
        menuManager.add(closeOthers);
        menuManager.add(closeAll);

        site.addSystemActions(menuManager);
    } // End of system menu initialization

}
 
源代码7 项目: tmxeditor8   文件: StandardEditorSystemMenu.java
/**
 * Create the standard view menu
 * 
 * @param site the site to associate the view with
 */
public StandardEditorSystemMenu(IStackPresentationSite site) {
    restore = new SystemMenuRestore(site);
    move = new SystemMenuMove(site, getMoveMenuText(), false);
    minimize = new SystemMenuMinimize(site);
    maximize = new SystemMenuMaximize(site);
    close = new SystemMenuClose(site);
    closeOthers = new SystemMenuCloseOthers(site);
    closeAll = new SystemMenuCloseAll(site);
    
    { // Initialize system menu
        menuManager.add(new GroupMarker("misc")); //$NON-NLS-1$
        menuManager.add(new GroupMarker("restore")); //$NON-NLS-1$
        menuManager.add(new UpdatingActionContributionItem(restore));

        menuManager.add(move);
        menuManager.add(new GroupMarker("size")); //$NON-NLS-1$
        menuManager.add(new GroupMarker("state")); //$NON-NLS-1$
        menuManager.add(new UpdatingActionContributionItem(minimize));

        menuManager.add(new UpdatingActionContributionItem(maximize));
        menuManager.add(new Separator("close")); //$NON-NLS-1$
        menuManager.add(close);
        menuManager.add(closeOthers);
        menuManager.add(closeAll);

        site.addSystemActions(menuManager);
    } // End of system menu initialization

}
 
源代码8 项目: nebula   文件: PresentationFactory.java
/** 
 * {@inheritDoc}
 */
@Override
public StackPresentation createEditorPresentation(Composite parent, IStackPresentationSite site)
{
    return new CTabFolderStackPresentation(site,parent);
}
 
public StackPresentation createEditorPresentation(Composite parent,
		IStackPresentationSite site) {
	DefaultTabFolder folder = new DefaultTabFolder(parent,
			editorTabPosition | SWT.BORDER, site
					.supportsState(IStackPresentationSite.STATE_MINIMIZED),
			site.supportsState(IStackPresentationSite.STATE_MAXIMIZED));

	/*
	 * Set the minimum characters to display, if the preference is something
	 * other than the default. This is mainly intended for RCP applications
	 * or for expert users (i.e., via the plug-in customization file).
	 * 
	 * Bug 32789.
	 */
	final IPreferenceStore store = PlatformUI.getPreferenceStore();
	if (store
			.contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) {
		final int minimumCharacters = store
				.getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS);
		if (minimumCharacters >= 0) {
			folder.setMinimumCharacters(minimumCharacters);
		}
	}

	PresentablePartFolder partFolder = new PresentablePartFolder(folder);

	TabbedStackPresentation result = new TabbedStackPresentation(site,
			partFolder, new StandardEditorSystemMenu(site));

	DefaultThemeListener themeListener = new DefaultThemeListener(folder,
			result.getTheme());
	result.getTheme().addListener(themeListener);

	new DefaultMultiTabListener(result.getApiPreferences(),
			IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder);

	new DefaultSimpleTabListener(result.getApiPreferences(),
			IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
			folder);

	return result;
}
 
public StackPresentation createEditorPresentation(Composite parent,
		IStackPresentationSite site) {
	DefaultTabFolder folder = new DefaultTabFolder(parent,
			editorTabPosition | SWT.BORDER, site
					.supportsState(IStackPresentationSite.STATE_MINIMIZED),
			site.supportsState(IStackPresentationSite.STATE_MAXIMIZED));

	/*
	 * Set the minimum characters to display, if the preference is something
	 * other than the default. This is mainly intended for RCP applications
	 * or for expert users (i.e., via the plug-in customization file).
	 * 
	 * Bug 32789.
	 */
	final IPreferenceStore store = PlatformUI.getPreferenceStore();
	if (store
			.contains(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS)) {
		final int minimumCharacters = store
				.getInt(IWorkbenchPreferenceConstants.EDITOR_MINIMUM_CHARACTERS);
		if (minimumCharacters >= 0) {
			folder.setMinimumCharacters(minimumCharacters);
		}
	}

	PresentablePartFolder partFolder = new PresentablePartFolder(folder);

	TabbedStackPresentation result = new TabbedStackPresentation(site,
			partFolder, new StandardEditorSystemMenu(site));

	DefaultThemeListener themeListener = new DefaultThemeListener(folder,
			result.getTheme());
	result.getTheme().addListener(themeListener);

	new DefaultMultiTabListener(result.getApiPreferences(),
			IWorkbenchPreferenceConstants.SHOW_MULTIPLE_EDITOR_TABS, folder);

	new DefaultSimpleTabListener(result.getApiPreferences(),
			IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
			folder);

	return result;
}
 
源代码11 项目: nebula   文件: EmptyStandaloneStackPresentation.java
public EmptyStandaloneStackPresentation(IStackPresentationSite stackSite, Composite parent)
{
    super(stackSite);
    
    partParent = parent;
    
    borderComposite = new Composite(parent,SWT.BORDER);
    
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法