本文整理了Java中org.eclipse.swt.widgets.Shell.getText()
方法的一些代码示例,展示了Shell.getText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getText()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:getText
暂无
代码示例来源:origin: pentaho/pentaho-kettle
@Override public void shellActivated( ShellEvent shellEvent ) {
super.shellActivated( shellEvent );
if ( deprecation ) {
return;
}
String deprecated = BaseMessages.getString( PKGBASE, "JobCategory.Category.Deprecated" ).toLowerCase();
shell.setText( shell.getText() + " (" + deprecated + ")" );
deprecation = true;
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public WindowProperty( Shell shell ) {
name = shell.getText();
maximized = shell.getMaximized();
rectangle = shell.getBounds();
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override public void shellActivated( ShellEvent shellEvent ) {
super.shellActivated( shellEvent );
if ( !stepMeta.isDeprecated() || deprecation ) {
return;
}
String deprecated = BaseMessages.getString( PKG, "BaseStep.Category.Deprecated" ).toLowerCase();
shell.setText( shell.getText() + " (" + deprecated + ")" );
deprecation = true;
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
Shell shell = canvas.getShell();
MessageBox dialog = new MessageBox( shell, SWT.ICON_WARNING | SWT.OK );
dialog.setText( shell.getText() );
dialog.setMessage( "Warning: Device is not tracking resource allocation" );
dialog.open();
代码示例来源:origin: pentaho/pentaho-kettle
public static void setSize( Shell shell, int prefWidth, int prefHeight ) {
PropsUI props = PropsUI.getInstance();
WindowProperty winprop = props.getScreen( shell.getText() );
if ( winprop != null ) {
winprop.setShell( shell, prefWidth, prefHeight );
} else {
shell.layout();
winprop = new WindowProperty( shell.getText(), false, new Rectangle( 0, 0, prefWidth, prefHeight ) );
winprop.setShell( shell );
// Now, as this is the first time it gets opened, try to put it in the middle of the screen...
Rectangle shellBounds = shell.getBounds();
Monitor monitor = shell.getDisplay().getPrimaryMonitor();
if ( shell.getParent() != null ) {
monitor = shell.getParent().getMonitor();
}
Rectangle monitorClientArea = monitor.getClientArea();
int middleX = monitorClientArea.x + ( monitorClientArea.width - shellBounds.width ) / 2;
int middleY = monitorClientArea.y + ( monitorClientArea.height - shellBounds.height ) / 2;
shell.setLocation( middleX, middleY );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
try {
databaseDialogInstance = new DatabaseConnectionDialog();
if ( ( (Shell) this.parentShell ).getText().contains( "Metadata Editor" ) ) {
databaseDialogInstance.registerClass( EXTENDED_WIDGET_ID, PMD_WIDGET_CLASSNAME );
} else {
代码示例来源:origin: pentaho/pentaho-kettle
public static void setSize( Shell shell, int minWidth, int minHeight, boolean packIt ) {
PropsUI props = PropsUI.getInstance();
WindowProperty winprop = props.getScreen( shell.getText() );
if ( winprop != null ) {
winprop.setShell( shell, minWidth, minHeight );
} else {
if ( packIt ) {
shell.pack();
} else {
shell.layout();
}
// OK, sometimes this produces dialogs that are waay too big.
// Try to limit this a bit, m'kay?
// Use the same algorithm by cheating :-)
//
winprop = new WindowProperty( shell );
winprop.setShell( shell, minWidth, minHeight );
// Now, as this is the first time it gets opened, try to put it in the middle of the screen...
Rectangle shellBounds = shell.getBounds();
Monitor monitor = shell.getDisplay().getPrimaryMonitor();
if ( shell.getParent() != null ) {
monitor = shell.getParent().getMonitor();
}
Rectangle monitorClientArea = monitor.getClientArea();
int middleX = monitorClientArea.x + ( monitorClientArea.width - shellBounds.width ) / 2;
int middleY = monitorClientArea.y + ( monitorClientArea.height - shellBounds.height ) / 2;
shell.setLocation( middleX, middleY );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
PropsUI props = PropsUI.getInstance();
WindowProperty winprop = props.getScreen( shell.getText() );
if ( winprop != null ) {
winprop.setShell( shell, minWidth, minHeight );
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding
@Override
String doGetStringValue(Object source) {
return ((Shell) source).getText();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
public String getTitle() {
return shell.getText();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public String getTitle() {
Shell shell = window.getShell();
if (shell != null && !shell.isDisposed()) {
// update the cached title
windowTitle = shell.getText();
}
return windowTitle;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static void renderText( Shell shell ) {
renderProperty( shell, PROP_TEXT, shell.getText(), "" );
}
代码示例来源:origin: org.eclipse/org.eclipse.ltk.ui.refactoring
public RefactoringStatusDialog(Shell parent, ErrorWizardPage page, boolean backButton) {
this(page.getStatus(), parent, parent.getText(), backButton);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void showBlocked(Shell parentShell,
IProgressMonitor blockingMonitor, IStatus blockingStatus,
String blockedName) {
nestingDepth++;
if (outerMonitor == null) {
outerMonitor = blockingMonitor;
//Try to get a name as best as possible
if (blockedName == null && parentShell != null) {
blockedName = parentShell.getText();
}
BlockedJobsDialog.createBlockedDialog(parentShell, blockingMonitor,
blockingStatus, blockedName);
}
}
代码示例来源:origin: org.apache.uima/uimaj-ep-configurator
/**
* Creates the dialog area.
*
* @param parent the parent
* @param existing the existing
* @return the control
*/
protected Control createDialogArea(Composite parent, Object existing) {
Composite composite = (Composite) super.createDialogArea(parent);
createWideLabel(composite, dialogDescription);
if (null != existing)
getShell().setText(getShell().getText().replaceFirst("Add", "Edit"));
return composite;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static void writeText( final Shell shell ) throws IOException {
String text = shell.getText();
if( WidgetLCAUtil.hasChanged( shell, PROP_TEXT, text, "" ) ) {
JSWriter writer = JSWriter.getWriterFor( shell );
text = WidgetLCAUtil.escapeText( text, false );
writer.set( JSConst.QX_FIELD_CAPTION, text );
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Add an additional, optional filter to the viewer. If the filter text
* is cleared, this filter will be removed from the TreeViewer.
*
* @param filter
*/
protected void addFilter(ViewerFilter filter) {
viewerFilter = filter;
getViewer().addFilter(filter);
if (filterText != null) {
setFilterText(WorkbenchMessages.FilteredTree_FilterMessage);
textChanged();
}
cachedTitle = getShell().getText();
getShell().setText(
NLS.bind(
WorkbenchMessages.FilteredTree_FilteredDialogTitle,
cachedTitle));
}
代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui
private void resetDisabledIssues () {
MessageBox dlg = new MessageBox(shell, SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
dlg.setText(shell.getText());
dlg.setMessage("This command will re-enabled all issues that have been disabled.\nDo you want to proceed?");
if ( dlg.open() != SWT.YES ) return;
// Proceed
session.resetDisabledIssues();
issuesModel.updateTable(0, displayType, issueType);
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public void preserveValues( Shell shell ) {
preserveProperty( shell, PROP_ACTIVE_CONTROL, getActiveControl( shell ) );
preserveProperty( shell, PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell() );
preserveProperty( shell, PROP_TEXT, shell.getText() );
preserveProperty( shell, PROP_IMAGE, shell.getImage() );
preserveProperty( shell, PROP_ALPHA, Integer.valueOf( shell.getAlpha() ) );
preserveProperty( shell, PROP_MODE, getMode( shell ) );
preserveProperty( shell, PROP_FULLSCREEN, Boolean.valueOf( shell.getFullScreen() ) );
preserveProperty( shell, PROP_MINIMUM_SIZE, shell.getMinimumSize() );
preserveProperty( shell, PROP_DEFAULT_BUTTON, shell.getDefaultButton() );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public void preserveValues( final Widget widget ) {
ControlLCAUtil.preserveValues( ( Control )widget );
Shell shell = ( Shell )widget;
IWidgetAdapter adapter = WidgetUtil.getAdapter( shell );
adapter.preserve( PROP_ACTIVE_CONTROL, getActiveControl( shell ) );
adapter.preserve( PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell() );
adapter.preserve( PROP_TEXT, shell.getText() );
adapter.preserve( PROP_IMAGE, shell.getImage() );
adapter.preserve( PROP_ALPHA, new Integer( shell.getAlpha() ) );
adapter.preserve( PROP_MODE, getMode( shell ) );
adapter.preserve( PROP_FULLSCREEN,
Boolean.valueOf( shell.getFullScreen() ) );
adapter.preserve( PROP_SHELL_LISTENER,
Boolean.valueOf( ShellEvent.hasListener( shell ) ) );
adapter.preserve( PROP_SHELL_MENU, shell.getMenuBar() );
adapter.preserve( PROP_MINIMUM_SIZE, shell.getMinimumSize() );
WidgetLCAUtil.preserveCustomVariant( shell );
}
内容来源于网络,如有侵权,请联系作者删除!