use of org.talend.componentdesigner.model.enumtype.JetFileStamp in project tdi-studio-se by Talend.
the class WizardJetFilesChoosePage method initialize.
@Override
protected void initialize() {
if (this.componentPref.getName() == null) {
useBeginButton.setSelection(true);
componentPref.setJetFileStamps(JetFileStamp.findFileStamps(true, false, false));
useDefaultResourceButton.setSelection(true);
final List<ResourceLanguageType> resourceTypes = new ArrayList<ResourceLanguageType>();
resourceTypes.add(ResourceLanguageType.DEFAULTRESOURCETYPE);
componentPref.setResourceLanguageTypes(resourceTypes);
defaultImageButton.setSelection(true);
} else {
// initialize jet file stamp
for (JetFileStamp fileStamp : componentPref.getJetFileStamps()) {
switch(fileStamp) {
case JETBEGINSTAMP:
this.useBeginButton.setSelection(true);
break;
case JETMAINSTAMP:
this.useMainButton.setSelection(true);
break;
case JETENDSTAMP:
this.useEndButton.setSelection(true);
break;
default:
}
}
// initialize resource file language
for (ResourceLanguageType resourceLangType : componentPref.getResourceLanguageTypes()) {
switch(resourceLangType) {
case DEFAULTRESOURCETYPE:
this.useDefaultResourceButton.setSelection(true);
break;
case ZHRESOURCETYPE:
this.useZHResourceButton.setSelection(true);
break;
case FRRESOURCETYPE:
this.useFRResourceButton.setSelection(true);
break;
default:
}
}
// initialize image selection
if (this.componentPref.getImageURL() == null) {
defaultImageButton.setSelection(true);
} else {
browserImageButton.setSelection(true);
imageDirectoryText.setText(componentPref.getImageURL());
}
// initialize library list selection
libComposite.setLibEntries(componentPref.getLibEntries());
}
setPageComplete(validatePage());
}
use of org.talend.componentdesigner.model.enumtype.JetFileStamp in project tdi-studio-se by Talend.
the class WizardJetFilesChoosePage method creatFilesSelectionGrp.
private void creatFilesSelectionGrp(Composite groupsComposite) {
Group filesSelectionGrp = new Group(groupsComposite, SWT.NONE);
//$NON-NLS-1$
filesSelectionGrp.setText("Select required Jet files");
// GridDataFactory.fillDefaults().span(1, 1).grab(true, false).applyTo(
// filesSelectionGrp);
filesSelectionGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridLayout groupLayout = new GridLayout(1, false);
filesSelectionGrp.setLayout(groupLayout);
// create the language selection check button
useBeginButton = new Button(filesSelectionGrp, SWT.CHECK | SWT.RIGHT);
//$NON-NLS-1$
useBeginButton.setText(Messages.getString("WizardJetFilesChoosePage.BeginFile"));
useMainButton = new Button(filesSelectionGrp, SWT.CHECK | SWT.RIGHT);
//$NON-NLS-1$
useMainButton.setText(Messages.getString("WizardJetFilesChoosePage.MainFile"));
useEndButton = new Button(filesSelectionGrp, SWT.CHECK | SWT.RIGHT);
//$NON-NLS-1$
useEndButton.setText(Messages.getString("WizardJetFilesChoosePage.EndFile"));
SelectionListener listener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
setPageComplete(validatePage());
List<JetFileStamp> jetFileTypes = JetFileStamp.findFileStamps(useBeginButton.getSelection(), useMainButton.getSelection(), useEndButton.getSelection());
componentPref.setJetFileStamps(jetFileTypes);
}
};
useBeginButton.addSelectionListener(listener);
useMainButton.addSelectionListener(listener);
useEndButton.addSelectionListener(listener);
}
use of org.talend.componentdesigner.model.enumtype.JetFileStamp in project tdi-studio-se by Talend.
the class ComponentPref method readToString.
/**
* Parse fields of current class to string.
*
* @return
*/
public String readToString() {
StringBuffer fields = new StringBuffer(getName() + FIELDS_SEPARATOR + getLanguageType().getNameSuffix() + FIELDS_SEPARATOR);
// 1. append jetFileTypes
if (this.getJetFileStamps().size() > 0) {
for (JetFileStamp fileStamp : getJetFileStamps()) {
fields.append(fileStamp.getFileStampName());
fields.append(INTERNAL_FIELDS_SEPARATOR);
}
}
fields.append(FIELDS_SEPARATOR);
// 2. append resourceFileTypes.
if (this.resourceLanguageTypes.size() > 0) {
for (ResourceLanguageType resourceType : resourceLanguageTypes) {
fields.append(resourceType.getLang());
fields.append(INTERNAL_FIELDS_SEPARATOR);
}
}
fields.append(FIELDS_SEPARATOR);
// 3. append imageUrl String.
if (this.imageURL == null) {
fields.append(PluginConstant.EMPTY_STRING);
} else {
fields.append(imageURL);
}
fields.append(FIELDS_SEPARATOR);
// 4. append library entries string.
if (libEntries != null && this.libEntries.length > 0) {
for (ILibEntry entry : this.libEntries) {
fields.append(entry.getName());
fields.append(EQUEL_FIELDS_SEPARATOR);
fields.append(entry.isExternal());
fields.append(EQUEL_FIELDS_SEPARATOR);
fields.append(entry.getLocation());
fields.append(INTERNAL_FIELDS_SEPARATOR);
}
}
return fields.toString();
}
Aggregations