当前位置: 首页>>代码示例>>Java>>正文


Java IPageChangingListener类代码示例

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


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

示例1: firePageChanging

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * Notifies any page changing listeners that the currently selected dialog
 * page is changing. Only listeners registered at the time this method is
 * called are notified.
 * 
 * @param event
 *          a selection changing event
 * 
 * @see IPageChangingListener#handlePageChanging(PageChangingEvent)
 * @since 3.3
 */
protected void firePageChanging(final PageChangingEvent event)
{
  Object[] listeners = pageChangingListeners.getListeners();
  for (int i = 0; i < listeners.length; ++i)
  {
    final IPageChangingListener l = (IPageChangingListener) listeners[i];
    SafeRunnable.run(new SafeRunnable()
    {
      public void run()
      {
        l.handlePageChanging(event);
      }
    });
  }
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:27,代码来源:LocalizedWizardDialog.java

示例2: firePageChanging

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * Notifies any page changing listeners that the currently selected dialog
 * page is changing. Only listeners registered at the time this method is
 * called are notified.
 * 
 * @param event
 *            a selection changing event
 * 
 * @see IPageChangingListener#handlePageChanging(PageChangingEvent)
 * @since 3.3
 */
protected void firePageChanging(final PageChangingEvent event) {
	Object[] listeners = pageChangingListeners.getListeners();
	for (int i = 0; i < listeners.length; ++i) {
		final IPageChangingListener l = (IPageChangingListener) listeners[i];
		SafeRunnable.run(new SafeRunnable() {
			public void run() {
				l.handlePageChanging(event);
			}
		});
	}
}
 
开发者ID:MentorEmbedded,项目名称:p2-installer,代码行数:23,代码来源:WizardDialog.java

示例3: setContainer

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
@Override
public void setContainer(IWizardContainer wizardContainer) {
	// TODO Auto-generated method stub
	
       super.setContainer(wizardContainer);
	if (wizardContainer == null)
	{
		if (this.dialog != null)
		{
			this.dialog = null;
		}
		return;
	}

	this.dialog = (WizardDialog)wizardContainer;
	this.dialog.addPageChangingListener(new IPageChangingListener() {
		

		@Override
		public void handlePageChanging(PageChangingEvent event) {
			// TODO Auto-generated method stub
			Object current = event.getCurrentPage();
			Object target = event.getTargetPage();
			
			List<IWizardPage> list = Arrays.asList(getPages());
			int idxCurrent = list.indexOf(current);
			int idxTarget = list.indexOf(target);
			
			java.lang.System.out.println("Current: "+current.getClass().getName()+"  ;;  Target: "+target.getClass().getName());
			if (current instanceof IWizardPageControll)
			{
                       if (idxCurrent < idxTarget)
                       {
                               // perform Next
                               ((IWizardPageControll)current).performNext();
                       }
                       else
                       {
                               // perform Back
                               ((IWizardPageControll)current).performBack();
                       }
			}
			
			if (target instanceof IWizardPageControll)
			{
				((IWizardPageControll)target).performUpdate();
				currentPage = (IWizardPageControll)target;
			}
			else
			{
				currentPage = null;
			}


			
		}
	});
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:59,代码来源:ImportWizard.java

示例4: createControl

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * @see IDialogPage#createControl(Composite)
 */
public void createControl(Composite parent) {
    int columns = 6; //定义列数
    
	ScrolledComposite scroll = new ScrolledComposite(parent,  SWT.NULL | SWT.V_SCROLL);
	scroll.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    //强制显示滚动条  
	scroll.setAlwaysShowScrollBars(false);  
	scroll.setExpandVertical(true);
	scroll.setExpandHorizontal(true);
    //拖动滚动条里可以看到的Composite的最大高度
	//(int)Toolkit.getDefaultToolkit().getScreenSize().getHeight()
	scroll.setMinHeight(700);  
	scroll.setLayout(new GridLayout(1, false));
	
    Composite container = new Composite(scroll, SWT.NULL);
    GridLayout glContainer = new GridLayout();
    glContainer.numColumns = columns;
    //glContainer.verticalSpacing = 2;
    container.setLayout(glContainer);
    scroll.setContent(container);

    createDatabaseArea(container, columns);

    createListTableArea(container, columns);

    createBaseProjectPath(container, columns);
    
    //定义Next事件
    WizardDialog dialog = (WizardDialog) getContainer();  
    dialog.addPageChangingListener(new IPageChangingListener() {  
        public void handlePageChanging(PageChangingEvent event) {
        	if(event.getCurrentPage() instanceof Config1MainRuleWizardPage
        			&& event.getTargetPage() instanceof Config2TableRelationWizardPage) {
                try {
                	gcRule.save();
                    updateStatus("成功保存配置到" + RmXmlHelper.formatToFile(gcRule.getMainRulePath()));
                } catch (Exception e1) {
                    updateStatus("保存失败:" + e1.toString());
                    e1.printStackTrace();
                    event.doit = false;
                }
        	}
        }  
    });
    
    initialize();
    setControl(container);
}
 
开发者ID:quickbundle,项目名称:qb-core,代码行数:52,代码来源:Config1MainRuleWizardPage.java

示例5: createControl

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
public void createControl(Composite parent) {
       final int columns = 7; //定义列数
   	Composite container = null;
   	//从父容器获得ScrolledComposite
   	if(parent.getChildren() != null && parent.getChildren().length > 1 && parent.getChildren()[1] instanceof ScrolledComposite) {
   		ScrolledComposite scroll = (ScrolledComposite)parent.getChildren()[1];
   		container = new Composite(scroll, SWT.NULL);
   		scroll.setContent(container);
   	} else {
   		container = new Composite(parent, SWT.NULL);
   	}
   	container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
   	container.setLayout(new GridLayout(columns, false));
   	final Composite containerFinal = container;
   	
   	//添加一组关系的按钮
       Button addRelationGroup = new Button(container, SWT.CENTER);
       GridData gd = new GridData(GridData.CENTER);
       gd.horizontalSpan = columns;
       addRelationGroup.setLayoutData(gd);
       addRelationGroup.setText("添加一组关系");
       addRelationGroup.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent e) {
               relations.add(addRelationGroup(containerFinal, columns, null));
           }
       });
   	
       initTableRelationWidget(container, columns);
       
       //定义Next事件
       final TableRelation tableRelationFinal = tableRelation;
       WizardDialog dialog = (WizardDialog) getContainer();  
       dialog.addPageChangingListener(new IPageChangingListener() {  
           public void handlePageChanging(PageChangingEvent event) {
           	if(event.getCurrentPage() instanceof Config2TableRelationWizardPage
           			&& event.getTargetPage() instanceof Config3MvmWizardPage) {
           		try {
           			//把界面上的表关系体现到Xml
           			tableRelationFinal.buildTableRelationXml(relations);
           			//把子表合并到主表的xml中
           			tableRelationFinal.mergeChildTable();
                   	gcRule.save();
                       updateStatus("成功保存配置到" + RmXmlHelper.formatToFile(gcRule.getMainRulePath()));
                   } catch (Exception e1) {
                       updateStatus("保存失败:" + e1.toString());
                       e1.printStackTrace();
                       event.doit = false;
                   }
           	}
           }  
       });  
       
       setControl(container);
	initialize();
	dialogChanged();
}
 
开发者ID:quickbundle,项目名称:qb-core,代码行数:57,代码来源:Config2TableRelationWizardPage.java

示例6: addPageChangingListener

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * Adds a listener for page changes to the list of page changing listeners
 * registered for this dialog. Has no effect if an identical listener is
 * already registered.
 * 
 * @param listener
 *            a page changing listener
 * @since 3.3
 */
public void addPageChangingListener(IPageChangingListener listener) {
	pageChangingListeners.add(listener);
}
 
开发者ID:MentorEmbedded,项目名称:p2-installer,代码行数:13,代码来源:WizardDialog.java

示例7: removePageChangingListener

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * Removes the provided page changing listener from the list of page
 * changing listeners registered for the dialog.
 * 
 * @param listener
 *            a page changing listener
 * @since 3.3
 */
public void removePageChangingListener(IPageChangingListener listener) {
	pageChangingListeners.remove(listener);
}
 
开发者ID:MentorEmbedded,项目名称:p2-installer,代码行数:12,代码来源:WizardDialog.java

示例8: addPageChangingListener

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * Adds a listener for page changes to the list of page changing listeners
 * registered for this dialog. Has no effect if an identical listener is
 * already registered.
 * 
 * @param listener
 *          a page changing listener
 * @since 3.3
 */
public void addPageChangingListener(IPageChangingListener listener)
{
  pageChangingListeners.add(listener);
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:14,代码来源:LocalizedWizardDialog.java

示例9: removePageChangingListener

import org.eclipse.jface.dialogs.IPageChangingListener; //导入依赖的package包/类
/**
 * Removes the provided page changing listener from the list of page changing
 * listeners registered for the dialog.
 * 
 * @param listener
 *          a page changing listener
 * @since 3.3
 */
public void removePageChangingListener(IPageChangingListener listener)
{
  pageChangingListeners.remove(listener);
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:13,代码来源:LocalizedWizardDialog.java


注:本文中的org.eclipse.jface.dialogs.IPageChangingListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。