MCPcopy Create free account
hub / github.com/MITK/MITK / CreatePart

Method CreatePart

Plugins/org.blueberry.ui.qt/src/internal/berryViewReference.cpp:137–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137IWorkbenchPart::Pointer ViewReference::CreatePart()
138{
139
140 // Check the status of this part
141
142 IWorkbenchPart::Pointer result;
143 PartInitException* exception = nullptr;
144
145 // Try to restore the view -- this does the real work of restoring the
146 // view
147 //
148 try
149 {
150 result = this->CreatePartHelper();
151 }
152 catch (const PartInitException& e)
153 {
154 exception = e.clone();
155 }
156
157 // If unable to create the part, create an error part instead
158 // and pass the error to the status handling facility
159 if (exception != nullptr)
160 {
161 // IStatus partStatus = exception.getStatus();
162 // IStatus displayStatus = StatusUtil.newStatus(partStatus,
163 // NLS.bind(WorkbenchMessages.ViewFactory_initException, partStatus.getMessage()));
164 // IStatus logStatus = StatusUtil
165 // .newStatus(
166 // partStatus,
167 // NLS
168 // .bind(
169 // "Unable to create view ID {0}: {1}", getId(), partStatus.getMessage())); //$NON-NLS-1$
170
171 // Pass the error to the status handling facility
172 // StatusManager.getManager().handle(logStatus);
173
174 QString errorTitle = "Unable to create view ID " + this->GetId();
175 WorkbenchPlugin::Log(errorTitle + ": " + exception->what());
176
177 IViewDescriptor::Pointer desc = factory->GetViewRegistry()->Find(
178 this->GetId());
179 QString label = this->GetId();
180 if (!desc.IsNull())
181 {
182 label = desc->GetLabel();
183 }
184
185 QString errorMsg(exception->what());
186 delete exception;
187
188 errorMsg
189 += "<ul><li>Check your shared library for unresolved symbols</li>"
190 "<li>Check your class attribute in your plugin.xml file</li>"
191 "<li>Check your manifest.cpp file</li></ul>";
192 ErrorViewPart::Pointer part(new ErrorViewPart(errorTitle, errorMsg));
193
194 //PartPane pane = getPane();

Callers

nothing calls this directly

Calls 13

CreatePartHelperMethod · 0.95
whatMethod · 0.80
cloneMethod · 0.45
GetIdMethod · 0.45
FindMethod · 0.45
GetViewRegistryMethod · 0.45
IsNullMethod · 0.45
GetLabelMethod · 0.45
GetWorkbenchPageMethod · 0.45
InitMethod · 0.45
SetPartNameMethod · 0.45
GetControlMethod · 0.45

Tested by

no test coverage detected