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


Java SWT.RIGHT属性代码示例

本文整理汇总了Java中org.eclipse.swt.SWT.RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.RIGHT属性的具体用法?Java SWT.RIGHT怎么用?Java SWT.RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.swt.SWT的用法示例。


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

示例1: getGroupSO

private SWTSkinObjectContainer getGroupSO(String groupID) {
	String soID = "toolbar-group-" + groupID;
	SWTSkinObjectContainer soGroup = (SWTSkinObjectContainer) skin.getSkinObjectByID(
			soID, soMain);

	if (soGroup == null) {
		soGroup = (SWTSkinObjectContainer) skin.createSkinObject(soID,
				"toolbar.group", soMain);
		FormData fd = (FormData) soGroup.getControl().getLayoutData();
		if (soLastGroup != null) {
			fd.left = new FormAttachment(soLastGroup.getControl(), 0, SWT.RIGHT);
		} else {
			fd.left = new FormAttachment(0, 2);
		}
	}

	soLastGroup = soGroup;

	return soGroup;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:20,代码来源:ToolBarView.java

示例2: createDialogArea

@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 2;

  Label usernameLabel = new Label( comp, SWT.RIGHT );
  usernameLabel.setText( "Username: " );
  usernameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  usernameText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  Label passwordLabel = new Label( comp, SWT.RIGHT );
  passwordLabel.setText( "Password: " );
  passwordText = new Text( comp, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD );
  passwordText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  return comp;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:19,代码来源:UsernamePasswordDialog.java

示例3: canContinue

private boolean canContinue() {
	if (shell == null || shell.isDisposed())
		return false;

	if (shellBounds == null)
		return true;

	//System.out.println((slideIn ? "In" : "Out") + ";" + direction + ";S:" + shellBounds + ";" + endBounds);
	if (slideIn) {
		if (direction == SWT.UP) {
			return shellBounds.y > endBounds.y;
		}
		// TODO: Other directions
	} else {
		if (direction == SWT.RIGHT) {
			// stop early, because some OSes have trim, and won't allow the window
			// to go smaller than it.
			return shellBounds.width > 10;
		}
	}
	return false;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:22,代码来源:ShellSlider.java

示例4: getAlignment

public static int getAlignment(String sAlign, int def) {
	int align;

	if (sAlign == null) {
		align = def;
	} else if (sAlign.equalsIgnoreCase("center")) {
		align = SWT.CENTER;
	} else if (sAlign.equalsIgnoreCase("bottom")) {
		align = SWT.BOTTOM;
	} else if (sAlign.equalsIgnoreCase("top")) {
		align = SWT.TOP;
	} else if (sAlign.equalsIgnoreCase("left")) {
		align = SWT.LEFT;
	} else if (sAlign.equalsIgnoreCase("right")) {
		align = SWT.RIGHT;
	} else {
		align = def;
	}

	return align;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:21,代码来源:SWTSkinUtils.java

示例5: toString

/**
 * Same as {@link #toString()}, but formatting can be fine tuned and number of pending tests can be included in
 * string (optional).
 *
 * @param showSkipped
 *            If true, will also show how many tests have been skipped.
 * @param pending
 *            If greater than 0, will also show this value in the string as the number of pending tests. Use 0 or
 *            negative value to hide this information.
 * @param alignment
 *            Alignment of the additional information on skipped and pending tests: one of {@link SWT#LEFT},
 *            {@link SWT#RIGHT}, or {@link SWT#NONE} (will hide all extra information).
 */
public String toString(boolean showSkipped, int pending, int alignment) {
	final int skipped = showSkipped
			? getCount(SKIPPED, SKIPPED_NOT_IMPLEMENTED, SKIPPED_PRECONDITION, SKIPPED_IGNORE, SKIPPED_FIXME) : 0;
	final StringBuffer sb = new StringBuffer();
	if (alignment == SWT.LEFT && (skipped > 0 || pending > 0)) {
		sb.append("(");
		if (pending > 0)
			sb.append(pending + " pending");
		if (pending > 0 && skipped > 0)
			sb.append(", ");
		if (skipped > 0)
			sb.append(skipped + " skipped");
		sb.append(")  ");
	}
	sb.append(getCount(PASSED));
	sb.append(" | ");
	sb.append(getCount(FAILED));
	sb.append(" | ");
	sb.append(getCount(ERROR));
	if (alignment == SWT.RIGHT && (skipped > 0 || pending > 0)) {
		sb.append("  (");
		if (skipped > 0)
			sb.append("skipped " + skipped);
		if (pending > 0 && skipped > 0)
			sb.append(", ");
		if (pending > 0)
			sb.append("pending " + pending);
		sb.append(")");
	}
	return sb.toString();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:44,代码来源:TestStatusCounter.java

示例6: fillCoolBar

@Override
protected void fillCoolBar ( final ICoolBarManager coolBar )
{
    final IToolBarManager toolbar = new ToolBarManager ( SWT.FLAT | SWT.RIGHT );
    coolBar.add ( new ToolBarContributionItem ( toolbar, "main" ) );
    toolbar.add ( getAction ( ActionFactory.NEW_WIZARD_DROP_DOWN.getId () ) );
    coolBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:ApplicationActionBarAdvisor.java

示例7: createTestContainerSelectionGroup

private void createTestContainerSelectionGroup (Composite parent) {
	Label fTestLabel = new Label(parent, SWT.NONE);
	GridData gd = new GridData( );
	gd.horizontalAlignment = SWT.RIGHT;
	gd.horizontalIndent = 25;
	gd.verticalAlignment=SWT.TOP;
	fTestLabel.setLayoutData(gd);
	fTestLabel.setText(MessageUtil.getString("mainTestExecutionContext"));
	 
	fMainTestExecutionComboViewer = new ComboViewer(parent,SWT.DROP_DOWN);
	Combo combo = fMainTestExecutionComboViewer.getCombo();
	combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	fMainTestExecutionComboViewer.setContentProvider(new   IStructuredContentProvider(){
		@Override
		public Object[] getElements(Object inputElement) {
			String projectName= (String) inputElement;
			loadMainExecutionContextTests(projectName);
			return mainExecutionContexts;
		}
	});
	ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_QUALIFIED);
	fMainTestExecutionComboViewer.setLabelProvider(labelProvider);
	fMainTestExecutionComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
        	 	fAdditionalTestViewer.setInput(null);
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                if (selection.size() > 0){
                	  resetDoHint();
                      IType type =  (IType) selection.getFirstElement();
                      fAdditionalTestViewer.setInput(type);
                      validatePage();
                }
        }
	});
	combo.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4E_LAUNCH_TEST_CONFIGURATION_MAIN_TEST);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:37,代码来源:GW4ELaunchConfigurationTab.java

示例8: computeGap

private int computeGap() {
	final int widthOfTextAndImage = computeSizeOfTextAndImages().x;
	switch (this.alignment) {
	case SWT.CENTER:
		return (getWidth() - widthOfTextAndImage) / 2;
	case SWT.RIGHT:
		return getWidth() - widthOfTextAndImage - MARGIN;
	default:
		return MARGIN;
	}
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:11,代码来源:BreadcrumbItem.java

示例9: createSearchTextBox

private void createSearchTextBox(Composite headerComposite) {
	searchTextBox = new Text(headerComposite, SWT.BORDER);
	GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, true, true, 0, 0);
	gd_searchTextBox.widthHint = 191;
	searchTextBox.setLayoutData(gd_searchTextBox);
	searchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128,128,128));
	searchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
	addListnersToSearchTextBox();
	ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(searchTextBox);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:AvailableFieldsComposite.java

示例10: convertSWTAlignmentToColumn

private static int convertSWTAlignmentToColumn(int align) {
	if ((align & SWT.LEAD) != 0) {
		return TableColumn.ALIGN_LEAD;
	} else if ((align & SWT.CENTER) != 0) {
		return TableColumn.ALIGN_CENTER;
	} else if ((align & SWT.RIGHT) != 0) {
		return TableColumn.ALIGN_TRAIL;
	}
	return TableColumn.ALIGN_LEAD;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:10,代码来源:TableColumnSWTUtils.java

示例11: setAlign

public void setAlign ( final int alignment )
{
    this.left = ( alignment & SWT.RIGHT ) != SWT.RIGHT;
    relayoutParent ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:YAxisDynamicRenderer.java

示例12: ProgressComposite

public ProgressComposite ( final Composite parent, final int style, final DataItemDescriptor descriptor, final String format, final String decimal, final String attribute, final double max, final double min, final double factor, final int width, final String hdConnectionId, final String hdItemId, final String queryString )
{
    super ( parent, style, format, decimal, false, attribute );

    if ( max != 0 )
    {
        this.max = max;
    }

    if ( min != 0 )
    {
        this.min = min;
    }

    if ( factor != 0 )
    {
        this.factor = factor;
    }

    if ( width > 0 )
    {
        this.width = width;
    }

    addDisposeListener ( new DisposeListener () {

        @Override
        public void widgetDisposed ( final DisposeEvent e )
        {
            ProgressComposite.this.handleDispose ();
        }
    } );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.progressWidth = this.width - this.textWidth - layout.spacing;
    if ( this.progressWidth < 1 )
    {
        this.progressWidth = 1;
    }

    this.controlImage = new ControlImage ( this, this.registrationManager );
    Helper.createTrendButton ( this.controlImage, hdConnectionId, hdItemId, queryString );

    this.progressBar = new ProgressBar ( this, SWT.NONE );
    //        this.progressBar.setSize ( this.progressWidth, this.textHeight );
    final RowData progressData = new RowData ( this.progressWidth, SWT.DEFAULT );
    this.progressBar.setLayoutData ( progressData );
    final int minimum = (int)Math.round ( this.min );
    final int maximum = (int)Math.round ( this.max );
    this.progressBar.setMinimum ( minimum );
    this.progressBar.setMaximum ( maximum );

    this.text = new Text ( this, SWT.MULTI | SWT.WRAP | SWT.RIGHT );
    //        final RowData rowData = new RowData ( 60, SWT.DEFAULT );
    //        this.font = new Font ( getDisplay (), new FontData ( "Arial", 10, 0 ) ); //$NON-NLS-1$
    //        this.text.setFont ( this.font );
    final RowData rowData = new RowData ( this.textWidth, this.textHeight );
    //        this.dataText.setAlignment ( SWT.RIGHT );
    this.text.setLayoutData ( rowData );
    this.text.setEnabled ( true );
    this.text.setEditable ( false );

    this.text.setText ( "" ); //$NON-NLS-1$
    new DescriptorLabel ( this, SWT.NONE, format, descriptor );

    if ( descriptor != null )
    {
        this.controlImage.setDetailItem ( descriptor.asItem () );
        this.registrationManager.registerItem ( "value", descriptor.getItemId (), descriptor.getConnectionInformation (), false, false ); //$NON-NLS-1$
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:77,代码来源:ProgressComposite.java

示例13: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 *
 * @param parentShell The parent windows' Shell.
 */
private void createShell(Shell parentShell) {
	// Set up the sell.
	this.shell = new Shell(this.display, SWT.BORDER);
	this.shell.setLayout(new GridLayout(3, false));
	this.shell.setText("Fast Execution...");

	// Check if the number of instructions is greater than an int value. Find a divisor in that case.
	if (this.numberOfInstructions > Integer.MAX_VALUE) {
		this.divisor = (double) this.numberOfInstructions / (double) Integer.MAX_VALUE;
	}

	// Components
	GridData gridData = new GridData();
	gridData.horizontalSpan = 2;

	this.informationLabel = new Label(this.shell, SWT.NONE);
	this.informationLabel.setText("Executing " + this.numberOfInstructions + " instructions...");
	this.informationLabel.setLayoutData(gridData);

	this.button = new Button(this.shell, SWT.PUSH);
	this.button.setText("&Stop");
	this.shell.setDefaultButton(this.button);

	this.instructionsText = new Text(this.shell, SWT.BORDER | SWT.RIGHT);
	this.instructionsText.setBackground(this.shell.getDisplay().getSystemColor(SWT.COLOR_WHITE));
	this.instructionsText.setText("     " + String.valueOf(this.numberOfInstructions));
	this.instructionsText.setEditable(false);

	this.progressBar = new ProgressBar(this.shell, SWT.HORIZONTAL | SWT.SMOOTH);
	this.progressBar.setMinimum(0);
	this.progressBar.setMaximum((int) (this.numberOfInstructions / this.divisor));

	this.percentText = new Text(this.shell, SWT.BORDER | SWT.RIGHT);
	this.percentText.setBackground(this.shell.getDisplay().getSystemColor(SWT.COLOR_WHITE));
	this.percentText.setText("    " + "00%");
	this.percentText.setEditable(false);

	// Listener.
	/**
	 * Close the window.
	 */
	this.button.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event event) {
			doExit();
		}
	});

	// Escape Listener.
	this.shell.addKeyListener(new EscKeyListener(this));
	this.informationLabel.addKeyListener(new EscKeyListener(this));
	this.button.addKeyListener(new EscKeyListener(this));
	this.instructionsText.addKeyListener(new EscKeyListener(this));
	this.progressBar.addKeyListener(new EscKeyListener(this));
	this.percentText.addKeyListener(new EscKeyListener(this));

	// Compute the needed size.
	Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	point.x += 2;
	point.y += 2;
	int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
	this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:67,代码来源:FastExecutionWindow.java

示例14: createDialogArea

@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 3;

  Label nameLabel = new Label( comp, SWT.RIGHT );
  nameLabel.setText( "Name: " );
  nameLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  nameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  nameText.setText( Const.NVL( repo.getName(), "" ) );
  nameText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );

  Label descLabel = new Label( comp, SWT.RIGHT );
  descLabel.setText( "Description: " );
  descLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  descText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  descText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
  descText.setText( Const.NVL( repo.getDescription(), "" ) );

  Label directoryLabel = new Label( comp, SWT.RIGHT );
  directoryLabel.setText( "Directory: " );
  directoryLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  directoryText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  directoryText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false ) );
  directoryText.setText( Const.NVL( repo.getDirectory(), "" ) );

  Button directoryButton = new Button( comp, SWT.PUSH );
  directoryButton.setText( "Browse" );
  directoryButton.addSelectionListener( new SelectionAdapter() {
    @Override
    public void widgetSelected( SelectionEvent e ) {
      DirectoryDialog dialog = new DirectoryDialog( getShell(), SWT.OPEN );
      if ( dialog.open() != null ) {
        directoryText.setText( dialog.getFilterPath() );
      }
    }
  } );

  Label typeLabel = new Label( comp, SWT.RIGHT );
  typeLabel.setText( "Type: " );
  typeLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  typeCombo = new Combo( comp, SWT.READ_ONLY );
  typeCombo.setItems( IVCS.GIT, IVCS.SVN );
  if ( repo.getType() != null ) {
    if ( repo.getType().equals( IVCS.GIT ) ) {
      typeCombo.select( 0 );
    } else {
      typeCombo.select( 1 );
    }
  }
  typeCombo.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
  return comp;
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:55,代码来源:EditRepositoryDialog.java

示例15: createDialogArea

/**
 * Create contents of the dialog.
 * 
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
	container.getShell().setText(windowLabel);
	
	int CONST_HEIGHT = 181;
			
			Shell shell = container.getShell();
			
			shell.addControlListener(new ControlAdapter() {
	            @Override
	            public void controlResized(ControlEvent e) {
	                Rectangle rect = shell.getBounds();
	                if(rect.width != CONST_HEIGHT) {
	                    shell.setBounds(rect.x, rect.y, rect.width, CONST_HEIGHT);
	                }
	            }
	        });
	
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayout(new GridLayout(2, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	chunkSize = new Label(composite, SWT.NONE);
	GridData gd_chunkSize = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_chunkSize.widthHint = 150;
	chunkSize.setLayoutData(gd_chunkSize);
	chunkSize.setText(Messages.DB_CHUNK_SIZE);

	chunkSizeTextBox = new Text(composite, SWT.BORDER);
	GridData gd_chunkSizeTextBox = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
	gd_chunkSizeTextBox.horizontalIndent = 10;
	chunkSizeTextBox.setLayoutData(gd_chunkSizeTextBox);
	chunkSizeTextBox.setText(CHUNK_SIZE_VALUE);
	controlDecoration = WidgetUtility.addDecorator(chunkSizeTextBox, Messages.DB_NUMERIC_PARAMETERZIATION_ERROR);
	controlDecoration.hide();
	controlDecoration.setMarginWidth(2);

	additionalDBParametersLabel = new Label(composite, SWT.NONE);
	GridData gd_additionalDBParametersLabel = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
	gd_additionalDBParametersLabel.widthHint = 150;
	additionalDBParametersLabel.setLayoutData(gd_additionalDBParametersLabel);
	additionalDBParametersLabel.setText(Messages.ADDITIONAL_DB_PARAMETERS);

	additionalParameterTextBox = new Text(composite, SWT.BORDER);
	additionalParameterControlDecoration = WidgetUtility.addDecorator(additionalParameterTextBox,Messages.ADDITIONAL_PARAMETER_ERROR_DECORATOR_MESSAGE);
	additionalParameterControlDecoration.setMarginWidth(2);
	additionalParameterControlDecoration.hide();
	GridData gd_additionalParameter = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
	gd_additionalParameter.horizontalIndent = 10;
	additionalParameterTextBox.setLayoutData(gd_additionalParameter);

	addListenerToChunkSize(chunkSizeTextBox);
	
	addModifyListener(chunkSizeTextBox);
	addModifyListener(additionalParameterTextBox);

	addListenerToAdditionalParameter(additionalParameterTextBox);

	addOutputAdditionalParameterValues();
	
	getShell().setMinimumSize(getInitialSize());
	
	setPropertyHelpText();

	return container;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:73,代码来源:OutputAdditionalParametersDialog.java


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