1

After reloading this effect disappears and labels are in their suitable sizes. This repeats only if the application is reloaded. On English locale, this dialog shows normally. Chinese text truncation

Example of code containing problem label:

private void createDailyGroup(Composite composite)
{
    m_typePanels[DAILY] = new Composite(composite, SWT.NONE);
    Composite panel = m_typePanels[DAILY];
    panel.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).create());
    panel.setLayoutData(GridDataFactory.fillDefaults().create());

    addRunTime(panel, DAILY);
}
 private void addRunTime(Composite panel, int scheduleType)
{
    Label runTimeLabel = new Label(panel, SWT.NONE);
    runTimeLabel.setText(QmfResources.getString(IDS_RUNTIME_LABEL));
    runTimeLabel.setLayoutData(GridDataFactory.fillDefaults().
        align(SWT.BEGINNING, SWT.CENTER).grab(false, false).create());
    m_runTimes.put(Integer.valueOf(scheduleType), new DateTime(panel, SWT.TIME | SWT.BORDER | SWT.SHORT));
    DateTime runTime = m_runTimes.get(Integer.valueOf(scheduleType));
    runTime.addSelectionListener(m_parametersChangeListener);
    runTime.setLayoutData(GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).create());
}
andreytemn
  • 55
  • 4

1 Answers1

1

Try below code, here I am considering runTimeLabel is label where you want to add Chinese locale string

runTimeLabel.getParent().requestLayout();
runTimeLabel.getParent().redraw();
runTimeLabel.getParent().getParent().update();
Shashwat
  • 2,342
  • 1
  • 17
  • 33
  • If possible provide more information on your code. As similar issue we had for German text which we solved. May you are not calling layout for correct composite. You can use layout() method too. – Shashwat May 24 '18 at 06:01