本文整理了Java中org.eclipse.swt.widgets.Label.pack()
方法的一些代码示例,展示了Label.pack()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.pack()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:pack
暂无
代码示例来源:origin: pentaho/pentaho-kettle
wlEachRow.pack();
wlSingleStatement = new Label( shell, SWT.RIGHT );
wlSingleStatement.setText( BaseMessages.getString( PKG, "ExecSQLDialog.SingleStatement.Label" ) );
wlSingleStatement.pack();
wlVariables = new Label( shell, SWT.RIGHT );
wlVariables.setText( BaseMessages.getString( PKG, "ExecSQLDialog.ReplaceVariables" ) );
wlVariables.pack();
wlQuoteString = new Label( shell, SWT.RIGHT );
wlQuoteString.setText( BaseMessages.getString( PKG, "ExecSQLDialog.QuoteString.Label" ) );
wlQuoteString.pack();
Rectangle rEachRow = wlEachRow.getBounds();
Rectangle rSingleStatement = wlSingleStatement.getBounds();
代码示例来源:origin: eclipse-color-theme/eclipse-color-theme
private void updateDetails(ColorTheme theme) {
if (theme == null)
themeDetails.setVisible(false);
else {
authorLabel.setText("Created by " + theme.getAuthor());
String website = theme.getWebsite();
if (website == null || website.length() == 0)
websiteLink.setVisible(false);
else {
websiteLink.setText("<a>" + website + "</a>");
for (Listener listener : websiteLink.getListeners(
SWT.Selection))
websiteLink.removeListener(SWT.Selection, listener);
setLinkTarget(websiteLink, website);
websiteLink.setVisible(true);
}
String id = theme.getId();
Browser browser = getBrowser();
if (browser != null)
browser.setUrl(
"http://www.eclipsecolorthemes.org/static/themes/java/"
+ id + ".html");
themeDetails.setVisible(true);
authorLabel.pack();
websiteLink.pack();
}
}
代码示例来源:origin: de.dentrassi.eclipse.neoscada.chart/org.eclipse.scada.chart.swt
public void setTitle ( final String title )
{
checkWidget ();
this.title.setText ( title );
this.title.pack ();
layout ();
}
代码示例来源:origin: org.eclipse.neoscada.chart/org.eclipse.scada.chart.swt
public void setTitle ( final String title )
{
checkWidget ();
this.title.setText ( title );
this.title.pack ();
layout ();
}
代码示例来源:origin: BiglySoftware/BiglyBT
public void
setIconImage(
Image image )
{
if ( icon_label != null &&
image != icon_label.getImage()){
icon_label.setImage( image );
icon_label.pack();
icon_label.redraw();
}
}
代码示例来源:origin: rinde/RinSim
@Override
public void run() {
if (!canvas.isDisposed()) {
if (clock.getTickLength() > TIME_FORMATTER_THRESHOLD) {
final StringBuilder sb = new StringBuilder();
sb.append(FORMATTER.print(new Period(0, clock.getCurrentTime())));
if (isRealtime) {
sb.append(SPACE);
sb.append(
((RealtimeClockController) clock).getClockMode().name());
}
timeLabel.setText(sb.toString());
} else {
timeLabel.setText(Long.toString(clock.getCurrentTime()));
}
timeLabel.pack();
canvas.redraw();
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
public Shell open (Display display) {
final Shell shell = new Shell (display);
final Label label = new Label (shell, SWT.CENTER);
label.setText (resHello.getString("Hello_world"));
label.pack();
shell.addControlListener(ControlListener.controlResizedAdapter(e -> label.setBounds (shell.getClientArea ())));
shell.pack();
shell.open ();
return shell;
}
}
代码示例来源:origin: org.xworker/xworker_swt
Label l = (Label) t;
l.setText(v.toString());
l.pack();
}else if(t instanceof Button){
Button b = (Button) t;
代码示例来源:origin: org.xworker/xworker_swt
Label l = (Label) control;
l.setText(UtilData.format(value, pattern));
l.pack();
}else if(control instanceof Button){
Button b = (Button) control;
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
private void showSummary(boolean show)
{
if (clientOnly_)
show = true; //short circuit to eliminate flicker...
hLinkClientEAR_.setVisible(show && needEar_);
hLinkClientProject_.setVisible(show);
hLinkClientRuntime_.setVisible(show);
hLinkClientServer_.setVisible(show);
if (show)
{
clientDetailsLabel_.setText(ConsumptionUIMessages.LABEL_SUMMARY);
}
else
{
if (clientOnly_)
hCompClient_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_CLIENT_ONLY);
else
hCompClient_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_CLIENT);
clientDetailsLabel_.setText(ConsumptionUIMessages.LABEL_SUMMARY_NO_CLIENT);
}
clientDetailsLabel_.pack(true);
hLinkClientProject_.pack(true);
hLinkClientEAR_.pack(true);
packIt();
}
代码示例来源:origin: org.xworker/xworker_swt
l.setText(UtilData.format(value, viewPattern));
l.pack();
}else if(control instanceof Button){
Button b = (Button) control;
代码示例来源:origin: rinde/RinSim
/**
* Configure shell.
*/
void createContent(Composite parent) {
canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED | SWT.NONE
| SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL);
canvas.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
origin = new org.eclipse.swt.graphics.Point(0, 0);
size = START_SCREEN_SIZE;
canvas.addPaintListener(this);
canvas.addControlListener(this);
this.layout();
timeLabel = new Label(canvas, SWT.NONE);
timeLabel.setText("hello world");
timeLabel.pack();
timeLabel.setLocation(TIME_LABEL_LOC);
timeLabel
.setBackground(canvas.getDisplay().getSystemColor(SWT.COLOR_WHITE));
hBar = canvas.getHorizontalBar();
hBar.addSelectionListener(this);
vBar = canvas.getVerticalBar();
vBar.addSelectionListener(this);
}
代码示例来源:origin: BiglySoftware/BiglyBT
protected final Label createFixedTextLabel(String msg_key, boolean add_colon, boolean bold) {
assertConstructing();
Label result = new Label(splash, SWT.NONE);
result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);
result.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
result.setText(MessageText.getString(msg_key) + ((add_colon) ? ":" : ""));
if (bold) {
if (this.bold_font == null) {
this.bold_font = createBoldFont(result.getFont());
}
result.setFont(this.bold_font);
}
result.addMouseListener(this.mListener);
result.addMouseMoveListener(this.mMoveListener);
result.pack();
result.setLocation(this.xSize, 0);
result.setMenu(this.menu);
if (this.hSize == -1) {
int hSizeText = result.getSize().y;
int hSizeImage = this.lDrag.getSize().y;
this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage;
}
this.xSize += result.getSize().x + 3;
return( result );
}
代码示例来源:origin: org.xworker/xworker_swt
afterPageLabel.pack();
afterPageItem.setWidth(afterPageLabel.getSize().x + 5);
代码示例来源:origin: org.xworker/xworker_swt
if(beforePageText != null){
beforePageLabel.setText(beforePageText);
beforePageLabel.pack();
beforePageItem.setWidth(beforePageLabel.getSize().x + 5);
if(afterPageTextStr != null){
afterPageLabel.setText(afterPageTextStr.replace("{0}", "0"));
afterPageLabel.pack();
afterPageItem.setWidth(afterPageLabel.getSize().x + 5);
代码示例来源:origin: BiglySoftware/BiglyBT
lDrag.pack();
内容来源于网络,如有侵权,请联系作者删除!