if(XPWidgetTheme.isPlatform()) {
PopupMenu popupMenu = new PopupMenu(text, XPWidgetTheme.THEME);
CMenu menu = new CMenu();
popupMenu.setMenu(menu);
text.setMenu(new Menu(text.getShell(), SWT.POP_UP));
CMenuItem item = new CMenuItem(SWT.NONE);
item.addSelectionListener(new SelectionAdapter() {
@SuppressWarnings("unused")
public void widgetSelected(SelectionEvent e) {
text.setText("");
}
});
item.setText("Clear");
menu.addItem(item);
} else {
Menu menu = new Menu(text.getShell(), SWT.POP_UP);
text.setMenu(menu);
MenuItem item = new MenuItem(menu, SWT.NONE);
item.addSelectionListener(new SelectionAdapter() {
@SuppressWarnings("unused")
public void widgetSelected(SelectionEvent e) {
text.setText("");
}
});
item.setText("Clear");
}
dialog = new AddPathButton(explorer, this);
}