本文整理汇总了Java中org.eclipse.swt.SWT.SPACE属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.SPACE属性的具体用法?Java SWT.SPACE怎么用?Java SWT.SPACE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.SPACE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConfigurableMenuItem
private MenuItem addConfigurableMenuItem(Menu menu, final String orgText,
final String acceleratorKey, SelectionListener listener) {
char accelerator = Config.getInstance().getString(acceleratorKey)
.toUpperCase().charAt(0);
int acc = SWT.MOD1 + (accelerator == ' ' ? SWT.SPACE : accelerator);
String text = orgText + " \t Ctrl+"
+ (accelerator == ' ' ? "[space]" : accelerator);
final MenuItem item = addMenuItem(menu, text, acc, listener);
Config.getInstance().addPropertyChangeListener(
new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent arg0) {
if (arg0.getProperty().equals(acceleratorKey))
updateAccelerator(item, orgText, Config
.getInstance().getString(acceleratorKey)
.toUpperCase().charAt(0));
}
});
return item;
}
示例2: updateAccelerator
private void updateAccelerator(MenuItem item, String itemText,
char newAccelerator) {
itemText += " \t Ctrl+"
+ (newAccelerator == ' ' ? "[space]" : newAccelerator);
int acc = SWT.MOD1
+ (newAccelerator == ' ' ? SWT.SPACE : newAccelerator);
item.setText(itemText);
item.setAccelerator(acc);
}
示例3: addAvailableFieldsProposals
@SuppressWarnings("unchecked")
private void addAvailableFieldsProposals(ITextViewer textViewer,Image image, List<ICompletionProposal> proposals,String prefix, int offset,int replacementLength) {
Map<String,Class<?>> fieldMap=(Map<String, Class<?>>)textViewer.getTextWidget().getData(ExpressionEditorDialog.FIELD_DATA_TYPE_MAP);
for(Entry<String, Class<?>> entry:fieldMap.entrySet()){
String display = entry.getKey()+SWT.SPACE+Constants.DASH+entry.getValue().getSimpleName();
String replacementString=SWT.SPACE+entry.getKey()+SWT.SPACE;
HydrographCompletionProposal customProposal=new HydrographCompletionProposal(replacementString,offset-prefix.length(),replacementLength,replacementString.length(),
image,display,null,null);
customProposal.setType(CUSTOM_TYPE);
proposals.add(customProposal);
}
}