use of org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard in project webtools.sourceediting by eclipse.
the class DataModelFacetCreationWizardPage method createPresetPanel.
protected void createPresetPanel(Composite top) {
final IFacetedProjectWorkingCopy workingCopy = ((ModifyFacetedProjectWizard) getWizard()).getFacetedProjectWorkingCopy();
final IFilter<IPreset> filter = new AbstractFilter<IPreset>() {
{
IFacetedProjectListener fpjwcListenerForPreset = new IFacetedProjectListener() {
@Override
public void handleEvent(final IFacetedProjectEvent event) {
handleProjectFacetsChangedEvent((IProjectFacetsChangedEvent) event);
}
};
facetedProjectListeners.add(fpjwcListenerForPreset);
workingCopy.addListener(fpjwcListenerForPreset, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
}
@Override
public boolean check(final IPreset preset) {
final IProjectFacetVersion primaryFacetVersion = getPrimaryFacetVersion();
return preset.getProjectFacets().contains(primaryFacetVersion);
}
private void handleProjectFacetsChangedEvent(final IProjectFacetsChangedEvent event) {
for (IProjectFacetVersion fv : event.getFacetsWithChangedVersions()) {
if (fv.getProjectFacet() == getPrimaryFacet()) {
final IFilterEvent<IPreset> filterEvent = new FilterEvent<IPreset>(this, IFilterEvent.Type.FILTER_CHANGED);
notifyListeners(filterEvent);
}
}
}
};
final PresetSelectionPanel ppanel = new PresetSelectionPanel(top, workingCopy, filter);
ppanel.setLayoutData(gdhfill());
}
use of org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard in project mdw-designer by CenturyLinkCloud.
the class ServerSettingsPage method initValues.
public void initValues() {
configurator = ServerConfigurator.Factory.create(getServerSettings());
ContainerType type = ServerSettings.getContainerTypeFromClass(this.getClass().getSimpleName());
if (type != null) {
String prevServerHome = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_HOME);
if (prevServerHome.length() > 0)
getServerSettings().setHome(prevServerHome);
if (getServerSettings().getHome() != null)
serverHomeTextField.setText(getServerSettings().getHome());
if (getServerSettings().isServiceMix())
getServerSettings().setContainerVersion("4.4.1");
if (getServerSettings().isFuse())
getServerSettings().setContainerVersion("6.1.0");
String prevJdkHome = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_JDK_HOME);
if (prevJdkHome.length() > 0)
getServerSettings().setJdkHome(prevJdkHome);
if (getServerSettings().getJdkHome() != null)
jdkHomeTextField.setText(getServerSettings().getJdkHome());
String prevServerHost = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_HOST);
if (prevServerHost.length() > 0 && getProject().isRemote())
getServerSettings().setHost(prevServerHost);
else
getServerSettings().setHost(ServerSettings.DEFAULT_HOST);
serverHostTextField.setText(getServerSettings().getHost());
String prevServerPort = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_PORT);
if (prevServerPort.length() > 0 && getProject().isRemote()) {
try {
getServerSettings().setPort(Integer.parseInt(prevServerPort));
} catch (NumberFormatException ex) {
MdwPlugin.setStringPref(type + "-" + ProjectPersist.MDW_SERVER_PORT, String.valueOf(getDefaultServerPort()));
}
} else {
getServerSettings().setPort(getDefaultServerPort());
}
serverPortTextField.setText(String.valueOf(getServerSettings().getPort()));
String prevServerUser = MdwPlugin.getStringPref(type + "-" + ProjectPersist.MDW_SERVER_USER);
if (prevServerUser.length() > 0)
getServerSettings().setUser(prevServerUser);
else
getServerSettings().setUser(getDefaultServerUser());
serverUserTextField.setText(getServerSettings().getUser());
}
if (!getProject().checkRequiredVersion(5, 0)) {
IProjectFacetVersion pfv = ProjectFacetsManager.getProjectFacet("mdw.workflow").getVersion("1.1");
IFacetedProjectWorkingCopy wc = ((ModifyFacetedProjectWizard) getWizard()).getFacetedProjectWorkingCopy();
wc.changeProjectFacetVersion(pfv);
}
}
Aggregations