org.eclipse.swt.widgets.Label.update()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.eclipse.swt.widgets.Label.update()方法的一些代码示例,展示了Label.update()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.update()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:update

Label.update介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
   * Updates the dialog message
   *
   * @param message
   *            new message
   */
  public void updateMessage(String message) {
    this.message = message;
    this.messageLabel.setText(message);
    this.messageLabel.update();
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

@Override
public void setTaskName(String name) {
  if (name == null) {
    task = "";//$NON-NLS-1$
  } else {
    task = name;
  }
  String s = task;
  if (s.length() <= 0) {
    s = DEFAULT_TASKNAME;
  }
  setMessage(s, false);
  if (!forked) {
    update();
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

public void setTaskName(String name) {
  if (name == null) {
    task = "";//$NON-NLS-1$
  } else {
    task = name;
  }
  String s = task;
  if (s.length() <= 0) {
    s = DEFAULT_TASKNAME;
  }
  setMessage(s, false);
  if (!forked) {
    update();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
public void setTaskName(String name) {
  if (name == null) {
    task = "";//$NON-NLS-1$
  } else {
    task = name;
  }
  String s = task;
  if (s.length() <= 0) {
    s = DEFAULT_TASKNAME;
  }
  setMessage(s, false);
  if (!forked) {
    update();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.team.ui

final protected void setErrorMessage(String error) {
  if(errorMessageLabel != null) {
    if(error == null || error.length() == 0) {
      errorMessageLabel.setText(""); //$NON-NLS-1$
    } else {
      errorMessageLabel.setText(error);
    }
    errorMessageLabel.update();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.team.ui

final protected void setErrorMessage(String error) {
  if(errorMessageLabel != null) {
    if(error == null || error.length() == 0) {
      errorMessageLabel.setText(""); //$NON-NLS-1$
    } else {
      errorMessageLabel.setText(error);
    }
    errorMessageLabel.update();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Update the message label. Required if the monitor is forked.
 */
private void update() {
  if (messageLabel == null || messageLabel.isDisposed()) {
    return;
  }
  messageLabel.update();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Update the message label. Required if the monitor is forked.
 */
private void update() {
  if (messageLabel == null || messageLabel.isDisposed()) {
    return;
  }
  messageLabel.update();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Update the message label. Required if the monitor is forked.
 */
private void update() {
  if (messageLabel == null || messageLabel.isDisposed()) {
    return;
  }
  messageLabel.update();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Updates the label with the current task and subtask names.
 */
protected void updateLabel() {
  if (blockedStatus == null) {
    String text = taskLabel();
    fLabel.setText(text);
  } else {
    fLabel.setText(blockedStatus.getMessage());
  }
  //Force an update as we are in the UI Thread
  fLabel.update();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Updates the label with the current task and subtask names.
 */
protected void updateLabel() {
  if (blockedStatus == null) {
    String text = taskLabel();
    fLabel.setText(text);
  } else {
    fLabel.setText(blockedStatus.getMessage());
  }
  //Force an update as we are in the UI Thread
  fLabel.update();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

public void subTask(String name) {
  if (subTaskLabel.isDisposed()) {
    return;
  }
  if (name == null) {
    fSubTask = "";//$NON-NLS-1$
  } else {
    fSubTask = name;
  }
  subTaskLabel.setText(shortenText(fSubTask, subTaskLabel));
  if (!forked) {
    subTaskLabel.update();
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

@Override
public void subTask(String name) {
  if (subTaskLabel.isDisposed()) {
    return;
  }
  if (name == null) {
    fSubTask = "";//$NON-NLS-1$
  } else {
    fSubTask = name;
  }
  subTaskLabel.setText(shortenText(fSubTask, subTaskLabel));
  if (!forked) {
    subTaskLabel.update();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
public void subTask(String name) {
  if (subTaskLabel.isDisposed()) {
    return;
  }
  if (name == null) {
    fSubTask = "";//$NON-NLS-1$
  } else {
    fSubTask = name;
  }
  subTaskLabel.setText(shortenText(fSubTask, subTaskLabel));
  if (!forked) {
    subTaskLabel.update();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Updates the label with the current task and subtask names.
 */
protected void updateLabel() {
  if (fLabel.isDisposed() || fLabel.isAutoDirection()) {
    return;
  }
  if (blockedStatus == null) {
    String text = taskLabel();
    fLabel.setText(text);
  } else {
    fLabel.setText(blockedStatus.getMessage());
  }
  // Force an update as we are in the UI Thread
  fLabel.update();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

public void beginTask(String name, int totalWork) {
  if (progressIndicator.isDisposed()) {
    return;
  }
  if (name == null) {
    task = "";//$NON-NLS-1$
  } else {
    task = name;
  }
  String s = task;
  if (s.length() <= 0) {
    s = DEFAULT_TASKNAME;
  }
  setMessage(s, false);
  if (!forked) {
    update();
  }
  if (totalWork == UNKNOWN) {
    progressIndicator.beginAnimatedTask();
  } else {
    progressIndicator.beginTask(totalWork);
  }
}

代码示例来源:origin: org.xworker/xworker_swt

public static void textEditorPaint(ActionContext actionContext){
  Event event = (Event) actionContext.get("event");
  StyledText text = (StyledText) event.widget;
  int line = text.getLineAtOffset(text.getCaretOffset()) + 1;
  int carOffset = text.getCaretOffset();
  int lineOffset = text.getOffsetAtLine(line - 1);
  Label statusLabel = (Label) actionContext.get("statusLabel");
  statusLabel.setText("" + line + ":" + (carOffset - lineOffset + 1));
  statusLabel.update();
}

代码示例来源:origin: BiglySoftware/BiglyBT

/**
 * Sets the defined color to the given <code>label</code>
 * @param label
 * @param text
 * @param showAsError <code>true</code> to show as error; <code>false</code> otherwise
 */
private void updateStatusLabel(String text, boolean showAsError) {
  if (null == statusLabel || statusLabel.isDisposed()) {
    return;
  }
    // we persist any error reports as these need to be sticky and not
    // overritten by subsequent messages
  if ( showAsError ){
    lastStatusError = text;
  }
  if ( lastStatusError != null ){
    showAsError = true;
    text = lastStatusError;
  }
  statusLabel.setText(formatForDisplay(text));
  if (!showAsError) {
    statusLabel.setForeground(normalColor);
  } else {
    statusLabel.setForeground(errorColor);
  }
  statusLabel.update();
}

代码示例来源:origin: org.xworker/xworker_swt

public static void textKeyDown(ActionContext actionContext){
  Event event = (Event) actionContext.get("event");
  
  StyledText text = (StyledText) event.widget;
  int line =  text.getLineAtOffset(text.getCaretOffset()) + 1;
  int carOffset = text.getCaretOffset();
  int lineOffset = text.getOffsetAtLine(line - 1);
  ((Label) text.getData("lineLabel")).setText("" + line + ":" + (carOffset - lineOffset + 1));
  ((Label) text.getData("lineLabel")).update();
  if(event.keyCode == 's' && event.stateMask == SWT.CTRL){
    SwtListener okButtonSelection = (SwtListener) actionContext.get("okButtonSelection");
    if(okButtonSelection != null){
       okButtonSelection.handleEvent(null);
    }
  }
}

代码示例来源:origin: org.xworker/xworker_swt

((Label) text.getData("lineLabel")).update();
}else {
  Text text = (Text) event.widget;

相关文章