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


Java ViewForm类代码示例

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


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

示例1: createControl

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
public void createControl(Composite parent) {

		ViewForm viewForm= new ViewForm(parent, SWT.BORDER | SWT.FLAT);

		Composite inner= new Composite(viewForm, SWT.NULL);
		GridLayout layout= new GridLayout();
		inner.setLayout(layout);

		createTreeAndSourceViewer(inner);
		createButtonComposite(inner);
		viewForm.setContent(inner);

		setControl(viewForm);

		Dialog.applyDialogFont(viewForm);
		PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.RENAME_TYPE_WIZARD_PAGE);
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:RenameTypeWizardSimilarElementsPage.java

示例2: run

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
void run() {
  if( adapter.getParent() != null ) {
    if( adapter.getParent().getLayout() instanceof StackLayout ) {
      reconcileStackLayout();
    }
    if( adapter.getParent() instanceof ViewForm ) {
      reconcileViewFormLayout();
    }
    if( adapter.getParent().getClass().getName().equals( "org.eclipse.ui.part.PageBook" ) ) {
      reconcilePageBookLayout();
    }
    if( adapter.getParent() instanceof SashForm ) {
      reconcileSashLayout();
    }
    if( adapter.getParent() instanceof CTabFolder ) {
      reconcileCTabFolder();
    }
  }
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:20,代码来源:LayoutReconciliation.java

示例3: reconcileViewFormLayout

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
private void reconcileViewFormLayout() {
  ViewForm viewForm = ( ViewForm )adapter.getParent();
  if( scrollable.isSameAs( viewForm.getContent() ) ) {
    viewForm.setContent( adapter );
    relayout( viewForm );
  }
  if( scrollable.isSameAs( viewForm.getTopCenter() ) ) {
    viewForm.setTopCenter( adapter );
    relayout( viewForm );
  }
  if( scrollable.isSameAs( viewForm.getTopLeft() ) ) {
    viewForm.setTopLeft( adapter );
    relayout( viewForm );
  }
  if( scrollable.isSameAs( viewForm.getTopRight() ) ) {
    viewForm.setTopRight( adapter );
    relayout( viewForm );
  }
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:20,代码来源:LayoutReconciliation.java

示例4: createViewform

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
/**
 * Creates a {@link ViewForm}
 * 
 * @param parent
 * @param style
 * @param cols
 * @param span
 * @param fill
 * @param marginwidth
 * @param marginheight
 * @return a new {@link ViewForm}
 */
public static ViewForm createViewform(Composite parent, int style, int cols, int span, int fill, int marginwidth,
		int marginheight) {
	ViewForm form = new ViewForm(parent, style);
	form.setFont(parent.getFont());
	GridLayout layout = new GridLayout(cols, false);
	layout.marginWidth = marginwidth;
	layout.marginHeight = marginheight;
	form.setLayout(layout);
	GridData gd = new GridData(fill);
	gd.horizontalSpan = span;
	form.setLayoutData(gd);
	return form;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:26,代码来源:SWTFactory.java

示例5: doToolbar

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
private ViewForm doToolbar( String title, final ItemModel model, final Composite parent){

      final ViewForm vForm = ViewUtils.buildViewForm(title, model, parent);
      final ToolBar bar = new ToolBar(vForm, SWT.FLAT);

      ToolItem i_raw = new ToolItem(bar, SWT.RADIO);
      i_raw.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.RAW));
      i_raw.setToolTipText("Raw View");

      ToolItem i_pretty = new ToolItem(bar, SWT.RADIO);
      i_pretty.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.PRETTY));
      i_pretty.setToolTipText("Pretty View");

      ToolItem i_json = new ToolItem(bar, SWT.RADIO);
      i_json.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.JSON));
      i_json.setToolTipText("JSON View");

      ToolItem i_hex = new ToolItem(bar, SWT.RADIO);
      i_hex.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.HEX));
      i_hex.setToolTipText("Hex View");

      ToolItem i_br = new ToolItem(bar, SWT.RADIO);
      i_br.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.BROWSER));
      i_br.setToolTipText("View in Browser");

      vForm.setTopCenter(bar);

      return vForm;
   }
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:30,代码来源:ResponseView.java

示例6: buildViewForm

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
static ViewForm buildViewForm( final String title, final ItemModel model, final Composite parent){
   final ViewForm vForm = new ViewForm(parent, SWT.NONE);

   // -- Label(vForm)
   final CLabel label = new CLabel(vForm, SWT.NONE);
   label.setText(CoreConstants.TITLE_SPACE + title + CoreConstants.TITLE_SPACE);
   label.setAlignment(SWT.LEFT);
   label.setBackground(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.TITLE_LINE));
   label.addMouseListener(new MouseAdapter() {
      public void mouseDoubleClick( MouseEvent e){
         int eventType = ModelEvent.UNKNOWN;
         if (CoreConstants.TITLE_HEADERS.equals(title)) {
            eventType = ModelEvent.HEADERS_RESIZED;

         } else if (CoreConstants.TITLE_PARAMETERS.equals(title)) {
            eventType = ModelEvent.PARAMS_RESIZED;

         } else if (CoreConstants.TITLE_BODY.equals(title)) {
            eventType = ModelEvent.BODY_RESIZED;

         } else if (CoreConstants.TITLE_REQUEST.equals(title)) {
            eventType = ModelEvent.REQUEST_RESIZED;

         } else if (CoreConstants.TITLE_RESPONSE.equals(title)) {
            eventType = ModelEvent.RESPONSE_RESIZED;
         }
         model.fireExecute(new ModelEvent(eventType, model));
      }
   });

   vForm.setTopLeft(label);

   return vForm;
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:35,代码来源:ViewUtils.java

示例7: getItem

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
public static ToolItem getItem( int position, ViewForm vForm){
   ToolItem item = null;
   Control[] arr1 = vForm.getChildren();
   for (int i = 0; i < arr1.length; i++) {
      if (arr1[i] instanceof ToolBar) {
         ToolBar tBar = (ToolBar) arr1[i];
         ToolItem[] arr2 = tBar.getItems();
         return arr2[position];
      }
   }
   return item;
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:13,代码来源:Utils.java

示例8: DetailsContentViewer

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
/**
 * Constructs a new instance of this class given its parent and a style
 * value describing its behavior and appearance.
 *
 * @param parent
 *            the parent component
 * @param style
 *            SWT style bits
 */
public DetailsContentViewer(Composite parent, int style) {
	viewForm = new ViewForm(parent, style);
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	viewForm.setLayoutData(gd);
	label = new CLabel(viewForm, SWT.FLAT);
	label.setFont(parent.getFont());
	viewForm.setContent(label);
	hookControl(label);
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:20,代码来源:FilteredItemsSelectionDialog.java

示例9: setUpWithViewFormOnContent

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
Rectangle setUpWithViewFormOnContent() {
  ViewForm viewForm = new ViewForm( shell, SWT.NONE );
  parent = viewForm;
  scrollable = createTree( viewForm, 1, 1 );
  adapter = new ScrollableAdapterFactory().create( scrollable, TreeAdapter.class ).get();
  adapter.setBounds( INITIAL_ADAPTER_BOUNDS );
  viewForm.setContent( scrollable );
  reconciliation = new LayoutReconciliation( adapter, new ScrollableControl<>( scrollable ) );
  shell.open();
  return INITIAL_ADAPTER_BOUNDS;
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:12,代码来源:LayoutReconciliationHelper.java

示例10: setUpWithViewFormOnTopCenter

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
Rectangle setUpWithViewFormOnTopCenter() {
  ViewForm viewForm = new ViewForm( shell, SWT.NONE );
  parent = viewForm;
  scrollable = createTree( viewForm, 1, 1 );
  adapter = new ScrollableAdapterFactory().create( scrollable, TreeAdapter.class ).get();
  adapter.setBounds( INITIAL_ADAPTER_BOUNDS );
  viewForm.setTopCenter( scrollable );
  reconciliation = new LayoutReconciliation( adapter, new ScrollableControl<>( scrollable ) );
  shell.open();
  return INITIAL_ADAPTER_BOUNDS;
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:12,代码来源:LayoutReconciliationHelper.java

示例11: setUpWithViewFormOnTopLeft

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
Rectangle setUpWithViewFormOnTopLeft() {
  ViewForm viewForm = new ViewForm( shell, SWT.NONE );
  parent = viewForm;
  scrollable = createTree( viewForm, 1, 1 );
  adapter = new ScrollableAdapterFactory().create( scrollable, TreeAdapter.class ).get();
  adapter.setBounds( INITIAL_ADAPTER_BOUNDS );
  viewForm.setTopLeft( scrollable );
  reconciliation = new LayoutReconciliation( adapter, new ScrollableControl<>( scrollable ) );
  shell.open();
  return INITIAL_ADAPTER_BOUNDS;
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:12,代码来源:LayoutReconciliationHelper.java

示例12: setUpWithViewFormOnTopRight

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
Rectangle setUpWithViewFormOnTopRight() {
  ViewForm viewForm = new ViewForm( shell, SWT.NONE );
  parent = viewForm;
  scrollable = createTree( viewForm, 1, 1 );
  adapter = new ScrollableAdapterFactory().create( scrollable, TreeAdapter.class ).get();
  adapter.setBounds( INITIAL_ADAPTER_BOUNDS );
  viewForm.setTopRight( scrollable );
  reconciliation = new LayoutReconciliation( adapter, new ScrollableControl<>( scrollable ) );
  shell.open();
  return INITIAL_ADAPTER_BOUNDS;
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:12,代码来源:LayoutReconciliationHelper.java

示例13: createViewform

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
/**
 * Creates a {@link ViewForm}
 * @param parent
 * @param style
 * @param cols
 * @param span
 * @param fill
 * @param marginwidth
 * @param marginheight
 * @return a new {@link ViewForm}
 * @since 3.6
 */
public static ViewForm createViewform(Composite parent, int style, int cols, int span, int fill, int marginwidth, int marginheight) {
	ViewForm form = new ViewForm(parent, style);
	form.setFont(parent.getFont());
	GridLayout layout = new GridLayout(cols, false);
       layout.marginWidth = marginwidth;
	layout.marginHeight = marginheight;
       form.setLayout(layout);
	GridData gd = new GridData(fill);
	gd.horizontalSpan = span;
	form.setLayoutData(gd);
	return form;
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:25,代码来源:SWTFactory.java

示例14: createControl

import org.eclipse.swt.custom.ViewForm; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void createControl(Composite parent) {
	fForm= new ViewForm(parent, SWT.BORDER | SWT.FLAT);
	fForm.marginWidth= 0;
	fForm.marginHeight= 0;

	fLabel= new CLabel(fForm, SWT.NONE);
	fLabel.setText(RefactoringMessages.ReferencesInBinaryStatusContextViewer_title);
	fForm.setTopLeft(fLabel);

	Composite composite= new Composite(fForm, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	GridLayout layout= new GridLayout(1, false);
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	composite.setLayout(layout);


	fTreeViewer= new TreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	final AppearanceAwareLabelProvider labelProvider= new AppearanceAwareLabelProvider();
	fTreeViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
	fTreeViewer.setComparator(new ViewerComparator() {
		private Collator fCollator= Collator.getInstance();
		@Override
		public int compare(Viewer viewer, Object e1, Object e2) {
			String l1= labelProvider.getText(e1);
			String l2= labelProvider.getText(e2);
			return fCollator.compare(l1, l2);
		}
	});
	fTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	fButton= new Button(composite, SWT.PUSH);
	fButton.setText(RefactoringMessages.ReferencesInBinaryStatusContextViewer_show_as_search_button);
	GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
	layoutData.widthHint= SWTUtil.getButtonWidthHint(fButton);
	fButton.setLayoutData(layoutData);
	fButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			fillInSearchView();
		}
	});
	fButton.setEnabled(false);

	fForm.setContent(composite);

	Dialog.applyDialogFont(parent);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:52,代码来源:ReferencesInBinaryStatusContextViewer.java


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