本文整理了Java中org.eclipse.swt.widgets.Text.append()
方法的一些代码示例,展示了Text.append()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.append()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Text
类名称:Text
方法名:append
[英]Appends a string.
The new text is appended to the text at the end of the widget.
[中]附加一个字符串。
新文本将附加到小部件末尾的文本中。
代码示例来源:origin: pentaho/pentaho-kettle
public void addLog( String line ) {
StringBuilder rest = new StringBuilder( XMLHandler.date2string( new Date() ) );
rest.append( " : " );
rest.append( line ).append( Const.CR );
wLogging.append( rest.toString() );
wLogging.setSelection( wLogging.getText().length() ); // make it scroll
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dragOver(DropTargetEvent event) {
dropConsole.append(">>dragOver\n");
printEvent(event);
event.feedback = dropFeedback;
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dragEnter(DropTargetEvent event) {
dropConsole.append(">>dragEnter\n");
printEvent(event);
if (event.detail == DND.DROP_DEFAULT) {
event.detail = dropDefaultOperation;
}
event.feedback = dropFeedback;
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dropAccept(DropTargetEvent event) {
dropConsole.append(">>dropAccept\n");
printEvent(event);
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dragLeave(DropTargetEvent event) {
dropConsole.append(">>dragLeave\n");
printEvent(event);
}
@Override
代码示例来源:origin: tvrenamer/tvrenamer
@Override
public void drop(DropTargetEvent event) {
String data = (String) event.data;
// TODO: This currently adds the dropped text onto the end, not where we dropped it
targetText.append(data);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dragOperationChanged(DropTargetEvent event) {
dropConsole.append(">>dragOperationChanged\n");
printEvent(event);
if (event.detail == DND.DROP_DEFAULT) {
event.detail = dropDefaultOperation;
}
event.feedback = dropFeedback;
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Logs a string to the event console.
*/
void log (String string) {
if (!eventConsole.isDisposed()) {
eventConsole.append (string);
eventConsole.append ("\n");
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
public void
append2(
String str )
{
txtInfo.append( str );
if ( str.contains( "\n" )){
// only scroll if the newly added text contains a new-line
// otherwise things get twitchy
txtInfo.setSelection( txtInfo.getTextLimit());
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
Object result = method.invoke(widgets[i]);
if (result == null) {
getText.append("null");
} else if (result.getClass().isArray()) {
int length = java.lang.reflect.Array.getLength(result);
getText.append(result.toString());
getText.append(e.toString());
getText.append("\n\n");
代码示例来源:origin: org.xworker/xworker_swt
public static void append(Object obj, String text) {
if(obj instanceof Text) {
((Text) obj).append(text);
}else if(StyledTextProxy.isStyledText(obj)) {
StyledTextProxy.append(obj, text);
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void runSupport() {
if ( !textMessages.isDisposed()){
if(step==null)
return;
//intercept progress indications.
if( step.startsWith("progress:")){
//expect format of string to be "progress: # : ..." where # is 0-100
int progressAmount = getProgressBarValueFromString(step);
progress.setSelection(progressAmount);
int[] timeLeft = getTimeLeftFromString(step);
if(timeLeft!=null){
//ToDo: use SimpleDateFormat ... to internationalize this.
testCountDown1.setText( ""+timeLeft[0]+" sec " );//
testCountDown2.setText( ""+timeLeft[1]+" sec " );
}else{
testCountDown1.setText(START_VALUES);
testCountDown2.setText(START_VALUES);
}
String modified = modifyProgressStatusString(step);
textMessages.append(modified);
}else{
//print non-progress strings as is.
textMessages.append( step + Text.DELIMITER);
}
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
protected void specialPopupMenuItems(Menu menu, Event event) {
MenuItem item = new MenuItem(menu, SWT.PUSH);
item.setText("getItem(Point) on mouse coordinates");
menuMouseCoords = table1.toControl(new Point(event.x, event.y));
item.addSelectionListener(widgetSelectedAdapter(e -> {
eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + table1.getItem(menuMouseCoords));
eventConsole.append ("\n");
}));
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
protected void specialPopupMenuItems(Menu menu, Event event) {
MenuItem item = new MenuItem(menu, SWT.PUSH);
item.setText("getItem(Point) on mouse coordinates");
final Tree t = (Tree) event.widget;
menuMouseCoords = t.toControl(new Point(event.x, event.y));
item.addSelectionListener(widgetSelectedAdapter(e -> {
eventConsole.append ("getItem(Point(" + menuMouseCoords + ")) returned: " + t.getItem(menuMouseCoords));
eventConsole.append ("\n");
}));
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.common.frameworks.ui
private void populateDetails(Text text, IStatus status, int nesting)
{
if (!status.matches(displayMask))
{
return;
}
String tabChars = repeat( ' ', nesting * 2 );
String messageLine = tabChars + status.getMessage() + System.getProperty("line.separator"); //$NON-NLS-1$
Throwable except = status.getException();
text.append( messageLine );
if( except != null )
{
String[] trace = getStackTrace( except );
for( int index = 0; index < trace.length; index++ )
{
text.append( tabChars + " " + trace[index] + System.getProperty("line.separator") ); //$NON-NLS-1$ //$NON-NLS-2$
}
}
IStatus[] children = status.getChildren();
for (int i = 0; i < children.length; i++)
{
populateDetails(text, children[i], nesting + 1);
}
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
text.append(Character.toString(e.character));
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dragFinished(org.eclipse.swt.dnd.DragSourceEvent event) {
dragConsole.append(">>dragFinished\n");
printEvent(event);
dragDataText = dragDataRTF = dragDataHTML = dragDataURL = null;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void drop(DropTargetEvent event) {
dropConsole.append(">>drop\n");
printEvent(event);
String[] strings = null;
dropConsole.append("!!Invalid data dropped");
return;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event) {
dragConsole.append(">>dragSetData\n");
printEvent(event);
if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
event.data = dragDataText;
}
if (RTFTransfer.getInstance().isSupportedType(event.dataType)) {
event.data = dragDataRTF;
}
if (HTMLTransfer.getInstance().isSupportedType(event.dataType)) {
event.data = dragDataHTML;
}
if (URLTransfer.getInstance().isSupportedType(event.dataType)) {
event.data = dragDataURL;
}
if (FileTransfer.getInstance().isSupportedType(event.dataType)) {
event.data = dragDataFiles;
}
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
if ((mask & WIDTH) != 0) event.width = setFieldsEvent.width;
if ((mask & HEIGHT) != 0) event.height = setFieldsEvent.height;
eventConsole.append (ControlExample.getResourceString("Returning"));
ignore = true;
log (event);
内容来源于网络,如有侵权,请联系作者删除!