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


Java Label.setImage方法代码示例

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


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

示例1: createTopContent

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
protected void createTopContent(String title, InputStream imageName) {
    Composite top = new Composite(composite, SWT.NONE);

    top.setLayout(new GridLayout(2, false));
    top.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    top.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
    
    final Image image = new Image(top.getDisplay(), imageName);
    Image resized = resizeImage(image, 48, 48);
    Label labelImage = new Label(top, SWT.CENTER);
    labelImage.setImage(resized);
    
    Label label = new Label(top, SWT.NONE);
    label.setText(title);
    final Font newFont = new Font(display, fontName, getTitleFontSize(), SWT.NORMAL);
    label.setFont(newFont);
    label.setBackground(rowColorSelection);
    
    createLineContent();
    
    top.addDisposeListener(e -> {
        newFont.dispose();
        resized.dispose();
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:26,代码来源:PluginDialog.java

示例2: createPartControl

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {

       if (system==null) {
	parent.setLayout(new GridLayout(1, false));
	final Label msg = new Label(parent, SWT.WRAP);
	msg.setText("No plotting system found available.\nThere are probably no bundles providing plotting in the run configuration.\nThese may be obtained from dawn p2, for instance:\nhttp://opengda.org/DawnDiamond/2.0/updates/release/\n\nA static image is shown for our enjoyment.");
	final Label img = new Label(parent, SWT.NONE);
	img.setImage(XcenActivator.getImageDescriptor("icons/xstall.png").createImage());
	return;
       }
       super.createPartControl(parent);


       // TODO Hard coded an x-stall, should come from current data acquisition.
       try {
		final File loc = new File(BundleUtils.getBundleLocation(XcenActivator.PLUGIN_ID), "icons/xstall.png");
		final IDataset image = service.getDataset(loc.getAbsolutePath(), new IMonitor.Stub());

		system.createPlot2D(image, null, new NullProgressMonitor());

       } catch (Exception ne) {
	logger.error("Cannot load dataset!", ne);
       }
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:26,代码来源:XcenDiagram.java

示例3: buildLeftColumn

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void buildLeftColumn() {
	final Composite composite = new Composite(this.shell, SWT.NONE);
	final GridData gd = new GridData(GridData.FILL, GridData.BEGINNING, false,
			true, 1, 1);
	composite.setLayoutData(gd);
	final FillLayout compositeLayout = new FillLayout();
	compositeLayout.marginWidth = 2;
	composite.setLayout(compositeLayout);
	final Label label = new Label(composite, SWT.NONE);
	if (this.image == null) {
		this.image = new Image(display, this.getClass().getClassLoader()
				.getResourceAsStream("images/document_wrench_color.png"));
		shell.addListener(SWT.Close, new Listener() {
			@Override
			public void handleEvent(Event event) {
				image.dispose();
			}
		});

	}
	label.setImage(this.image);
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:23,代码来源:TipDayEx.java

示例4: buildLeftColumn

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void buildLeftColumn() {
	final Composite composite = new Composite(this.shell, SWT.NONE);
	final GridData gd = new GridData(GridData.FILL, GridData.BEGINNING, false,
			true, 1, 1);
	composite.setLayoutData(gd);
	final FillLayout compositeLayout = new FillLayout();
	compositeLayout.marginWidth = 2;
	composite.setLayout(compositeLayout);
	final Label label = new Label(composite, SWT.NONE);
	if (this.image == null) {
		this.image = new Image(display, this.getClass().getClassLoader()
				.getResourceAsStream("images/light1.png"));
		shell.addListener(SWT.Close, new Listener() {
			@Override
			public void handleEvent(Event event) {
				image.dispose();
			}
		});

	}
	label.setImage(this.image);
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:23,代码来源:TipDayEx.java

示例5: createMiddleLayer

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void createMiddleLayer() {
	Composite middleComposite = new Composite(this, SWT.NONE);
	middleComposite.setLayout(new GridLayout(1, false));
	middleComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true, 1, 1));
	
	addAllSelectedPackagesLabel = new Label(middleComposite, SWT.NONE);
	addAllSelectedPackagesLabel.setBounds(6, 70, 25, 25);
	addAllSelectedPackagesLabel.setImage(ImagePathConstant.SELECT_ALL_ICON.getImageFromRegistry());
	addAllSelectedPackagesLabel.setToolTipText("Add all packages");
	addListenerToSelectAllLable(addAllSelectedPackagesLabel);
	addAllSelectedPackagesLabel.setEnabled(false);
	
	Label dummyLabel = new Label(middleComposite, SWT.NONE);
	
	addSelectedPackagesLabel = new Label(middleComposite, SWT.NONE);
	addSelectedPackagesLabel.setBounds(6, 110, 25, 25);
	addSelectedPackagesLabel.setImage(ImagePathConstant.SELECT_ICON.getImageFromRegistry());
	addSelectedPackagesLabel.setToolTipText("Add selected packages");
	addListenerToSelectLable(addSelectedPackagesLabel);
	addSelectedPackagesLabel.setEnabled(false);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:CategoriesDialogTargetComposite.java

示例6: createToolBarManagerWithTitle

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
protected void createToolBarManagerWithTitle(Composite parent, ToolBarConfiguration toolBarConfiguration, String toolBarId) {
	
	Composite compo = new Composite(composite, SWT.NONE);
	GridLayout layout = new GridLayout(3, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.verticalSpacing = 0;
	compo.setLayout(layout);
	compo.setLayoutData(new  GridData(GridData.FILL_HORIZONTAL));
	
	Label imageLabel = new Label(compo, SWT.NONE);
	imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
	imageLabel.setImage(AvroSchemaEditorActivator.getNoneImage());
	toolBarImageLabels.put(toolBarId, imageLabel);
	
	Label titleLabel = new Label(compo, SWT.NONE);
	titleLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	toolBarTextLabels.put(toolBarId, titleLabel);
	
	createToolBarManager(compo, toolBarConfiguration, toolBarId);
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:22,代码来源:SchemaViewer.java

示例7: createContents

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
@Override
protected void createContents() {

    ZnodeModel parentZnodeModel = getParentZnodeModel();

    Label connectionLabel = new Label(this, SWT.LEAD);
    connectionLabel.setText("Connection:");
    connectionLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));

    Label connectionImageLabel = new Label(this, SWT.LEAD);
    connectionImageLabel.setImage(ZooKeeperActivator
            .getManagedImage(ZooKeeperActivator.IMAGE_KEY_OBJECT_ZOO_KEEPER_CONNECTION));
    connectionImageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));

    Label connectionValueLabel = new Label(this, SWT.LEAD);
    connectionValueLabel.setText(parentZnodeModel.getOwnerModel().getKey().getName());
    connectionValueLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    addControl(CONTROL_NAME_CONNECTION_LABEL, connectionValueLabel);
    addControlDecoration(CONTROL_NAME_CONNECTION_LABEL, connectionValueLabel);

    Label parentLabel = new Label(this, SWT.LEAD);
    parentLabel.setText("Parent:");
    parentLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));

    Label parentImageLabel = new Label(this, SWT.LEAD);
    parentImageLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    addControl(CONTROL_NAME_PARENT_IMAGE_LABEL, parentImageLabel);
    updateParentZnodeImage();

    Label parentValueLabel = new Label(this, SWT.LEAD);
    parentValueLabel.setText(parentZnodeModel.getData().getPath());
    parentValueLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    addControl(CONTROL_NAME_PARENT_PATH_LABEL, parentValueLabel);
    addControlDecoration(CONTROL_NAME_PARENT_PATH_LABEL, parentValueLabel);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:37,代码来源:ZnodeNewWizardComposite.java

示例8: updateParentZnodeImage

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void updateParentZnodeImage() {
    ZnodeModel parentZnodeModel = getParentZnodeModel();
    Label parentImageLabel = (Label) getControl(CONTROL_NAME_PARENT_IMAGE_LABEL);
    if (parentImageLabel != null && !parentImageLabel.isDisposed()) {
        parentImageLabel.setImage(ZooKeeperActivator.getZnodeSmallImage(parentZnodeModel.getData()));
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:8,代码来源:ZnodeNewWizardComposite.java

示例9: attachRemoveRowButton

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void attachRemoveRowButton(Composite composite) {
	Label btnRemove = new Label(composite, SWT.NONE);
	btnRemove.setLayoutData(getGridControlButtonLayout());
	btnRemove.setText("");
	btnRemove.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
	addRemoveRowButtonListener(btnRemove);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:8,代码来源:ParameterGridDialog.java

示例10: attachAddRowButton

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void attachAddRowButton(Composite composite) {
	Label btnAdd = new Label(composite, SWT.NONE);
	GridData gd_btnAdd = getGridControlButtonLayout();
	btnAdd.setLayoutData(gd_btnAdd);
	btnAdd.setText("");
	btnAdd.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
	
	attachAddRowButtonListener(btnAdd);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:ParameterGridDialog.java

示例11: labelWidget

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
public Label labelWidget(Composite parent, int style, int[] bounds,
		String value, Image image) {
	Label label = new Label(parent, style);
	label.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
	label.setText(value);
	label.setImage(image);

	return label;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:ELTSWTWidgets.java

示例12: addButtonPanel

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
protected Composite addButtonPanel(Composite container) {
	Composite composite_1 = new Composite(container, SWT.NONE);
	composite_1.setLayout(new GridLayout(5, false));
	ColumnLayoutData cld_composite_1 = new ColumnLayoutData();
	cld_composite_1.horizontalAlignment = ColumnLayoutData.RIGHT;
	cld_composite_1.heightHint = 28;
	composite_1.setLayoutData(cld_composite_1);

	Label addButton = new Label(composite_1, SWT.NONE);
	addButton.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
	addButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	addButton.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
	attachAddButtonListern(addButton);

	deleteButton = new Label(composite_1, SWT.NONE);
	deleteButton.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
	deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
	attachDeleteButtonListener(deleteButton);

	upButton = new Label(composite_1, SWT.NONE);
	upButton.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
	upButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	upButton.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
	attachUpButtonListener(upButton);

	downButton = new Label(composite_1, SWT.NONE);
	downButton.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
	downButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	downButton.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
	attachDownButtonListerner(downButton);
	deleteButton.setEnabled(false);
	upButton.setEnabled(false);
	downButton.setEnabled(false);
	return composite_1;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:37,代码来源:HiveOutputFieldDialog.java

示例13: createButtonsForButtonBar

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
/**
 * Create contents of the button bar.
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
	parent.setLayout(new GridLayout(1, false));
	Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayout(new GridLayout(2, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	warningImageLabel = new Label(composite, SWT.NONE);
	warningImageLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
	
	warningImageLabel.setImage(ImagePathConstant.WARNING_ICON.getImageFromRegistry());

	warningLabel = new Label(composite, SWT.NONE);
	warningLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true, 1, 1));
	warningLabel.setText(Messages.WARNING_MESSAGE);

	warningLabel.setVisible(false);
	warningImageLabel.setVisible(false);
	if (!delimiterTextBox.getText().equalsIgnoreCase(",")
			|| !quoteCharactorTextBox.getText().equalsIgnoreCase("\"")) {
		warningImageLabel.setVisible(true);
		warningLabel.setVisible(true);
	}
	createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
	createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:ViewDataPreferencesDialog.java

示例14: setLabelImage

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
/**
 * @param label
 * @param key
 *
 * @since 4.0.0.5
 */
public void setLabelImage(Label label, final String key) {
	Image bg = getImage(key);
	label.setImage(bg);
	label.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			releaseImage(key);
		}
	});
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:17,代码来源:ImageLoader.java

示例15: createToolTipContentArea

import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
@Override
protected Composite createToolTipContentArea ( final Event event, final Composite parent )
{
    parent.setLayout ( new FillLayout () );
    final Composite wrapper = new Composite ( parent, SWT.NONE );

    wrapper.addDisposeListener ( new DisposeListener () {

        @Override
        public void widgetDisposed ( final DisposeEvent e )
        {
            DataItemToolTip.this.resourceManager.dispose ();
        }
    } );

    final GridLayout layout = new GridLayout ( 2, false );
    layout.marginHeight = 10;
    layout.marginWidth = 10;
    layout.horizontalSpacing = 20;
    layout.verticalSpacing = 20;

    wrapper.setLayout ( layout );
    wrapper.setBackground ( wrapper.getDisplay ().getSystemColor ( SWT.COLOR_WHITE ) );
    wrapper.setBackgroundMode ( SWT.INHERIT_DEFAULT );

    this.headerLabel = new Label ( wrapper, SWT.NONE );
    this.headerLabel.setText ( this.item.getId () );
    this.headerLabel.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false, 2, 1 ) );
    this.headerLabel.setFont ( JFaceResources.getHeaderFont () );

    final Label warnIcon = new Label ( wrapper, SWT.NONE );
    warnIcon.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, false, false ) );
    warnIcon.setImage ( Activator.getDefault ().getImageRegistry ().get ( Activator.IMG_WARN_BIG ) );

    this.text = new StyledText ( wrapper, SWT.MULTI );
    this.text.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );

    if ( this.currentText != null )
    {
        this.text.setText ( this.currentText.getString () );
        this.text.setStyleRanges ( this.currentText.getStyleRanges () );
    }

    return wrapper;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:46,代码来源:DataItemToolTip.java


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