use of org.eclipse.sapphire.ui.forms.DialogDef in project liferay-ide by liferay.
the class NewLiferayProfileMarkerResolution method promptUser.
@Override
protected int promptUser(IProject project, NewLiferayPluginProjectOp op) {
NewLiferayProfile newLiferayProfile = op.getNewLiferayProfiles().insert();
Reference<DialogDef> dialogRef = DefinitionLoader.sdef(NewLiferayPluginProjectWizard.class).dialog("NewLiferayProfile");
SapphireDialog dialog = new SapphireDialog(UIUtil.getActiveShell(), newLiferayProfile, dialogRef);
dialog.setBlockOnOpen(true);
int result = dialog.open();
if (result == SapphireDialog.OK) {
IDOMModel domModel = null;
try {
IFile pomFile = project.getFile(IMavenConstants.POM_FILE_NAME);
domModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(pomFile);
MavenUtil.createNewLiferayProfileNode(domModel.getDocument(), newLiferayProfile);
domModel.save();
} catch (Exception e) {
LiferayMavenCore.logError("Unable to save new Liferay profiles to project pom.", e);
} finally {
if (domModel != null) {
domModel.releaseFromEdit();
}
}
NewLiferayProfileActionHandler.addToActiveProfiles(op, newLiferayProfile);
} else {
op.getNewLiferayProfiles().remove(newLiferayProfile);
}
return result;
}
use of org.eclipse.sapphire.ui.forms.DialogDef in project liferay-ide by liferay.
the class PluginsSDKNotSetResolution method run.
public void run(IMarker marker) {
if (marker.getResource() instanceof IProject) {
final IProject proj = (IProject) marker.getResource();
final LiferayPluginSDKOp op = (LiferayPluginSDKOp) (LiferayPluginSDKOp.TYPE.instantiate().initialize());
DefinitionLoader loader = DefinitionLoader.context(getClass());
final Reference<DialogDef> dialogRef = loader.sdef("com.liferay.ide.project.ui.dialog.SelectPluginsSDKDialog").dialog("ConfigureLiferaySDK");
final SapphireDialog dialog = new SapphireDialog(UIUtil.getActiveShell(), op, dialogRef);
dialog.setBlockOnOpen(true);
final int result = dialog.open();
if (result != SapphireDialog.CANCEL) {
String sdkName = op.getPluginsSDKName().content();
SDKUtil.saveSDKNameSetting(proj, sdkName);
}
}
}
use of org.eclipse.sapphire.ui.forms.DialogDef in project liferay-ide by liferay.
the class SelectActiveProfilesMarkerResolution method promptUser.
protected int promptUser(IProject project, NewLiferayPluginProjectOp op) {
Reference<DialogDef> dialogRef = DefinitionLoader.sdef(NewLiferayPluginProjectWizard.class).dialog("SelectActiveProfiles");
SapphireDialog dialog = new SapphireDialog(UIUtil.getActiveShell(), op, dialogRef);
dialog.setBlockOnOpen(true);
return dialog.open();
}
Aggregations