本文整理汇总了Java中org.eclipse.gef.palette.PaletteEntry.PERMISSION_LIMITED_MODIFICATION属性的典型用法代码示例。如果您正苦于以下问题:Java PaletteEntry.PERMISSION_LIMITED_MODIFICATION属性的具体用法?Java PaletteEntry.PERMISSION_LIMITED_MODIFICATION怎么用?Java PaletteEntry.PERMISSION_LIMITED_MODIFICATION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.gef.palette.PaletteEntry
的用法示例。
在下文中一共展示了PaletteEntry.PERMISSION_LIMITED_MODIFICATION属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDescText
/**
* Creates the <code>Text</code> where the description of the entry is to be
* displayed.
*
* @param panel
* The Composite in which the <code>Text</code> is to be created
* @return The newly created <code>Text</code>
*/
protected Text createDescText(Composite panel) {
String desc = entry.getDescription();
Text description = createText(panel, SWT.MULTI | SWT.WRAP | SWT.BORDER
| SWT.V_SCROLL, desc);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = 150;
data.heightHint = description.computeTrim(0, 0, 10, FigureUtilities
.getFontMetrics(description.getFont()).getHeight() * 2).height;
description.setLayoutData(data);
if (getPermission() >= PaletteEntry.PERMISSION_LIMITED_MODIFICATION) {
description.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
handleDescriptionChanged(((Text) e.getSource()).getText());
}
});
}
return description;
}
示例2: createText
/**
* Creates a <code>Text</code>. This method is mainly a result of
* code-factoring.
*
* @param panel
* The Composite in which the Text is to be created
* @param style
* The stylebits for the Text
* @param text
* The text to be displayed in the Text
* @return a text widget with griddata constraint
*/
protected Text createText(Composite panel, int style, String text) {
if (getEntry() instanceof PaletteSeparator
|| getPermission() < PaletteEntry.PERMISSION_LIMITED_MODIFICATION) {
style = style | SWT.READ_ONLY;
}
Text textBox = new Text(panel, style);
textBox.setFont(panel.getFont());
if (text != null)
textBox.setText(text);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = 200;
textBox.setLayoutData(data);
return textBox;
}
示例3: createOpenDrawerInitiallyOption
/**
* Creates the button that provides the option to pin a drawer open at
* start-up.
*
* @param panel
* The parent Composite
* @return The button for the new option
*/
protected Button createOpenDrawerInitiallyOption(Composite panel) {
Button b = new Button(panel, SWT.CHECK);
b.setFont(panel.getFont());
b.setText(PaletteMessages.EXPAND_DRAWER_AT_STARTUP_LABEL);
b.setSelection(getDrawer().isInitiallyOpen());
if (getPermission() >= PaletteEntry.PERMISSION_LIMITED_MODIFICATION) {
b.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleOpenSelected(((Button) e.getSource()).getSelection());
}
});
} else {
b.setEnabled(false);
}
return b;
}
示例4: createPinDrawerInitiallyOption
/**
* Creates the button that provides the option to have a drawer open at
* start-up.
*
* @param panel
* The parent Composite
* @return The button for the new option
*/
protected Button createPinDrawerInitiallyOption(Composite panel) {
Button pinOption = new Button(panel, SWT.CHECK);
pinOption.setFont(panel.getFont());
pinOption.setText(PaletteMessages.DRAWER_PIN_AT_STARTUP);
GridData data = new GridData();
data.horizontalIndent = 15;
pinOption.setLayoutData(data);
pinOption.setEnabled(openDrawerOption.getSelection()
&& openDrawerOption.isEnabled());
pinOption.setSelection(getDrawer().isInitiallyPinned());
if (getPermission() >= PaletteEntry.PERMISSION_LIMITED_MODIFICATION) {
pinOption.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handlePinSelected(((Button) e.getSource()).getSelection());
}
});
}
return pinOption;
}
示例5: createNameText
/**
* Creates the Text where the name of the entry is to be displayed.
*
* @param panel
* The Composite in which the Text is to be created
* @return Text - The newly created Text
*/
protected Text createNameText(Composite panel) {
Text name = createText(panel, SWT.SINGLE | SWT.BORDER, entry.getLabel());
if (getPermission() >= PaletteEntry.PERMISSION_LIMITED_MODIFICATION) {
name.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
handleNameChanged(((Text) e.getSource()).getText());
}
});
}
name.setVisible(true);
return name;
}