use of org.pentaho.di.ui.core.widget.StyledTextComp in project pentaho-kettle by pentaho.
the class UserDefinedJavaClassDialog method buildingFolderMenu.
private void buildingFolderMenu() {
// styledTextPopupmenu = new Menu(, SWT.POP_UP);
MenuItem addNewItem = new MenuItem(cMenu, SWT.PUSH);
addNewItem.setText(BaseMessages.getString(PKG, "UserDefinedJavaClassDialog.AddNewTab"));
addNewItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
addCtab("", "", TabAddActions.ADD_BLANK);
}
});
MenuItem copyItem = new MenuItem(cMenu, SWT.PUSH);
copyItem.setText(BaseMessages.getString(PKG, "UserDefinedJavaClassDialog.AddCopy"));
copyItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
CTabItem item = folder.getSelection();
StyledTextComp st = (StyledTextComp) item.getControl();
addCtab(item.getText(), st.getText(), TabAddActions.ADD_COPY);
}
});
new MenuItem(cMenu, SWT.SEPARATOR);
MenuItem setActiveScriptItem = new MenuItem(cMenu, SWT.PUSH);
setActiveScriptItem.setText(BaseMessages.getString(PKG, "UserDefinedJavaClassDialog.SetTransformClass"));
setActiveScriptItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
CTabItem item = folder.getSelection();
for (int i = 0; i < folder.getItemCount(); i++) {
if (folder.getItem(i).equals(item)) {
if (item.getImage().equals(imageActiveScript)) {
strActiveScript = "";
}
item.setImage(imageActiveScript);
strActiveScript = item.getText();
} else if (folder.getItem(i).getImage().equals(imageActiveScript)) {
folder.getItem(i).setImage(imageInactiveScript);
}
}
modifyTabTree(item, TabActions.SET_ACTIVE_ITEM);
}
});
new MenuItem(cMenu, SWT.SEPARATOR);
MenuItem setRemoveScriptItem = new MenuItem(cMenu, SWT.PUSH);
setRemoveScriptItem.setText(BaseMessages.getString(PKG, "UserDefinedJavaClassDialog.RemoveClassType"));
setRemoveScriptItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
CTabItem item = folder.getSelection();
input.setChanged(true);
if (item.getImage().equals(imageActiveScript)) {
strActiveScript = "";
}
item.setImage(imageInactiveScript);
}
});
folder.setMenu(cMenu);
}
Aggregations